[llvm] r206611 - ARM64: disable generation of .loh directives outside MachO.

Tim Northover tnorthover at apple.com
Fri Apr 18 07:54:47 PDT 2014


Author: tnorthover
Date: Fri Apr 18 09:54:46 2014
New Revision: 206611

URL: http://llvm.org/viewvc/llvm-project?rev=206611&view=rev
Log:
ARM64: disable generation of .loh directives outside MachO.

Part of PR19455.

Modified:
    llvm/trunk/lib/Target/ARM64/ARM64TargetMachine.cpp
    llvm/trunk/test/CodeGen/ARM64/collect-loh.ll

Modified: llvm/trunk/lib/Target/ARM64/ARM64TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM64/ARM64TargetMachine.cpp?rev=206611&r1=206610&r2=206611&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM64/ARM64TargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/ARM64/ARM64TargetMachine.cpp Fri Apr 18 09:54:46 2014
@@ -165,7 +165,8 @@ bool ARM64PassConfig::addPreEmitPass() {
   // Relax conditional branch instructions if they're otherwise out of
   // range of their destination.
   addPass(createARM64BranchRelaxation());
-  if (TM->getOptLevel() != CodeGenOpt::None && EnableCollectLOH)
+  if (TM->getOptLevel() != CodeGenOpt::None && EnableCollectLOH &&
+      TM->getSubtarget<ARM64Subtarget>().isTargetMachO())
     addPass(createARM64CollectLOHPass());
   return true;
 }

Modified: llvm/trunk/test/CodeGen/ARM64/collect-loh.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM64/collect-loh.ll?rev=206611&r1=206610&r2=206611&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM64/collect-loh.ll (original)
+++ llvm/trunk/test/CodeGen/ARM64/collect-loh.ll Fri Apr 18 09:54:46 2014
@@ -1,4 +1,10 @@
 ; RUN: llc -mtriple=arm64-apple-ios -O2 -arm64-collect-loh -arm64-collect-loh-bb-only=false < %s -o - | FileCheck %s
+; RUN: llc -mtriple=arm64-linux-gnu -O2 -arm64-collect-loh -arm64-collect-loh-bb-only=false < %s -o - | FileCheck %s --check-prefix=CHECK-ELF
+
+; CHECK-ELF-NOT: .loh
+; CHECK-ELF-NOT: AdrpAdrp
+; CHECK-ELF-NOT: AdrpAdd
+; CHECK-ELF-NOT: AdrpLdrGot
 
 @a = internal unnamed_addr global i32 0, align 4
 @b = external global i32





More information about the llvm-commits mailing list