diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2020-01-17 20:45:01 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2020-01-17 20:45:01 +0000 | 
| commit | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (patch) | |
| tree | 4adf86a776049cbf7f69a1929c4babcbbef925eb /llvm/lib/Target/TargetMachine.cpp | |
| parent | 7cc9cf2bf09f069cb2dd947ead05d0b54301fb71 (diff) | |
Notes
Diffstat (limited to 'llvm/lib/Target/TargetMachine.cpp')
| -rw-r--r-- | llvm/lib/Target/TargetMachine.cpp | 19 | 
1 files changed, 9 insertions, 10 deletions
| diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp index 4c98e140f446..97a1eb2f190a 100644 --- a/llvm/lib/Target/TargetMachine.cpp +++ b/llvm/lib/Target/TargetMachine.cpp @@ -36,8 +36,8 @@ TargetMachine::TargetMachine(const Target &T, StringRef DataLayoutString,                               const TargetOptions &Options)      : TheTarget(T), DL(DataLayoutString), TargetTriple(TT), TargetCPU(CPU),        TargetFS(FS), AsmInfo(nullptr), MRI(nullptr), MII(nullptr), STI(nullptr), -      RequireStructuredCFG(false), DefaultOptions(Options), Options(Options) { -} +      RequireStructuredCFG(false), O0WantsFastISel(false), +      DefaultOptions(Options), Options(Options) {}  TargetMachine::~TargetMachine() = default; @@ -184,15 +184,14 @@ bool TargetMachine::shouldAssumeDSOLocal(const Module &M,      const Function *F = dyn_cast_or_null<Function>(GV);      if (F && F->hasFnAttribute(Attribute::NonLazyBind))        return false; - -    bool IsTLS = GV && GV->isThreadLocal(); -    bool IsAccessViaCopyRelocs = -        GV && Options.MCOptions.MCPIECopyRelocations && isa<GlobalVariable>(GV);      Triple::ArchType Arch = TT.getArch(); -    bool IsPPC = -        Arch == Triple::ppc || Arch == Triple::ppc64 || Arch == Triple::ppc64le; -    // Check if we can use copy relocations. PowerPC has no copy relocations. -    if (!IsTLS && !IsPPC && (RM == Reloc::Static || IsAccessViaCopyRelocs)) + +    // PowerPC prefers avoiding copy relocations. +    if (Arch == Triple::ppc || TT.isPPC64()) +      return false; + +    // Check if we can use copy relocations. +    if (!(GV && GV->isThreadLocal()) && RM == Reloc::Static)        return true;    } | 
