[PATCH] D108514: [TargetMachine] Move COFF special case for ExternalSymbolSDNode from shouldAssumeDSOLocal to X86Subtarget
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 23 13:54:47 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rGba6e15d8cc52: [TargetMachine] Move COFF special case for ExternalSymbolSDNode from… (authored by MaskRay).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D108514/new/
https://reviews.llvm.org/D108514
Files:
llvm/lib/Target/TargetMachine.cpp
llvm/lib/Target/X86/X86Subtarget.cpp
Index: llvm/lib/Target/X86/X86Subtarget.cpp
===================================================================
--- llvm/lib/Target/X86/X86Subtarget.cpp
+++ llvm/lib/Target/X86/X86Subtarget.cpp
@@ -143,6 +143,9 @@
return classifyLocalReference(GV);
if (isTargetCOFF()) {
+ // ExternalSymbolSDNode like _tls_index.
+ if (!GV)
+ return X86II::MO_NO_FLAG;
if (GV->hasDLLImportStorageClass())
return X86II::MO_DLLIMPORT;
return X86II::MO_COFFSTUB;
@@ -184,10 +187,13 @@
if (TM.shouldAssumeDSOLocal(M, GV))
return X86II::MO_NO_FLAG;
- // Functions on COFF can be non-DSO local for two reasons:
+ // Functions on COFF can be non-DSO local for three reasons:
+ // - They are intrinsic functions (!GV)
// - They are marked dllimport
// - They are extern_weak, and a stub is needed
if (isTargetCOFF()) {
+ if (!GV)
+ return X86II::MO_NO_FLAG;
if (GV->hasDLLImportStorageClass())
return X86II::MO_DLLIMPORT;
return X86II::MO_COFFSTUB;
Index: llvm/lib/Target/TargetMachine.cpp
===================================================================
--- llvm/lib/Target/TargetMachine.cpp
+++ llvm/lib/Target/TargetMachine.cpp
@@ -101,15 +101,11 @@
// 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())
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108514.368208.patch
Type: text/x-patch
Size: 1908 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210823/6bbfeb95/attachment.bin>
More information about the llvm-commits
mailing list