Skip to content

Commit

Permalink
[WebAssembly] Don't override default implementation of isOffsetFoldin…
Browse files Browse the repository at this point in the history
…gLegal. NFC.

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

llvm-svn: 356410
  • Loading branch information
sbc100 committed Mar 18, 2019
1 parent f89343b commit b7708ec
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion llvm/lib/Target/TargetMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 0 additions & 6 deletions llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class WebAssemblyTargetLowering final : public TargetLowering {
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,
Expand Down

0 comments on commit b7708ec

Please sign in to comment.