aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/TargetMachine.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2021-08-23 13:54:39 -0700
committerFangrui Song <i@maskray.me>2021-08-23 13:54:40 -0700
commitba6e15d8cc52fab35dde41ab34b43283554c9a59 (patch)
tree4eab4a7b5dce901df5a0a00032e4edb11b980da8 /llvm/lib/Target/TargetMachine.cpp
parent4c40c03b3933ce32a2b5f532810dc30f6f329fd4 (diff)
downloadllvm-ba6e15d8cc52fab35dde41ab34b43283554c9a59.zip
llvm-ba6e15d8cc52fab35dde41ab34b43283554c9a59.tar.gz
llvm-ba6e15d8cc52fab35dde41ab34b43283554c9a59.tar.bz2
[TargetMachine] Move COFF special case for ExternalSymbolSDNode from shouldAssumeDSOLocal to X86Subtarget
Intended to be NFC. ARM/AArch64 don't appear to need adjustment. TargetMachine::shouldAssumeDSOLocal is expected to be very simple, ideally matching isDSOLocal(). The IR producers are expected to set dso_local correctly. (While some may think this function can make producers' work easier, the function is really not in a good position to set dso_local. See the various special cases we duplicate from clang CodeGenModule.cpp.) Reviewed By: mstorsjo Differential Revision: https://reviews.llvm.org/D108514
Diffstat (limited to 'llvm/lib/Target/TargetMachine.cpp')
-rw-r--r--llvm/lib/Target/TargetMachine.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp
index 32bdb71..08295df 100644
--- a/llvm/lib/Target/TargetMachine.cpp
+++ b/llvm/lib/Target/TargetMachine.cpp
@@ -101,15 +101,11 @@ bool TargetMachine::shouldAssumeDSOLocal(const Module &M,
// dso_preemptable. At this point in time, the various IR producers
// have not been transitioned to always produce a dso_local when it
// is possible to do so.
- // In the case of ExternalSymbolSDNode, GV is null and we should just return
- // false. However, COFF currently relies on this to be true
//
// As a result we still have some logic in here to improve the quality of the
// generated code.
- // FIXME: Add a module level metadata for whether intrinsics should be assumed
- // local.
if (!GV)
- return TT.isOSBinFormatCOFF();
+ return false;
// If the IR producer requested that this GV be treated as dso local, obey.
if (GV->isDSOLocal())