]> granicus.if.org Git - llvm/commitdiff
[WebAssembly] Don't override default implementation of isOffsetFoldingLegal. NFC.
authorSam Clegg <sbc@chromium.org>
Mon, 18 Mar 2019 21:21:12 +0000 (21:21 +0000)
committerSam Clegg <sbc@chromium.org>
Mon, 18 Mar 2019 21:21:12 +0000 (21:21 +0000)
The default implementation does we want and is going to more compatible
with dynamic linking (-fPIC) support that is planned.

This is NFC because currently we only build wasm with
`-relocation-model=static` which in turn means that the default
`isOffsetFoldingLegal` always returns true today.

Differential Revision: https://reviews.llvm.org/D54661

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356410 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/TargetMachine.cpp
lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
lib/Target/WebAssembly/WebAssemblyISelLowering.h

index c08ed43fe6b063be176cb817df9b891a1d7bc94a..7a1e01bdab6721cea7c4071a16bc63892d9b676d 100644 (file)
@@ -161,7 +161,7 @@ bool TargetMachine::shouldAssumeDSOLocal(const Module &M,
   if (GV && !GV->hasDefaultVisibility())
     return true;
 
-  if (TT.isOSBinFormatMachO()) {
+  if (TT.isOSBinFormatMachO() || TT.isOSBinFormatWasm()) {
     if (RM == Reloc::Static)
       return true;
     return GV && GV->isStrongDefinitionForLinker();
index 9f81da01f906419ed78d4b843991f6c3e762fac0..aa7bba8b17d36184c91abbc47c78aa4d7a7a26e1 100644 (file)
@@ -294,12 +294,6 @@ FastISel *WebAssemblyTargetLowering::createFastISel(
   return WebAssembly::createFastISel(FuncInfo, LibInfo);
 }
 
-bool WebAssemblyTargetLowering::isOffsetFoldingLegal(
-    const GlobalAddressSDNode * /*GA*/) const {
-  // All offsets can be folded.
-  return true;
-}
-
 MVT WebAssemblyTargetLowering::getScalarShiftAmountTy(const DataLayout & /*DL*/,
                                                       EVT VT) const {
   unsigned BitWidth = NextPowerOf2(VT.getSizeInBits() - 1);
index ee2e863685a8d5f57369b3859ef7304a4068330a..81e85fc8a0c1741d4000789b7f0df90f50f9fb56 100644 (file)
@@ -46,7 +46,6 @@ private:
   AtomicExpansionKind shouldExpandAtomicRMWInIR(AtomicRMWInst *) const override;
   FastISel *createFastISel(FunctionLoweringInfo &FuncInfo,
                            const TargetLibraryInfo *LibInfo) const override;
-  bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const override;
   MVT getScalarShiftAmountTy(const DataLayout &DL, EVT) const override;
   MachineBasicBlock *
   EmitInstrWithCustomInserter(MachineInstr &MI,