summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2014-04-18 14:54:46 +0000
committerTim Northover <tnorthover@apple.com>2014-04-18 14:54:46 +0000
commit37d9a9cebf1076c246d80a0bd998459d2bd70130 (patch)
tree6aa8e21c74b29195681f4930716ad02cf36b1fe6
parentbe1d1b6681b28f9dd4bff0e14d4fd9aa63f90d64 (diff)
downloadbcm5719-llvm-37d9a9cebf1076c246d80a0bd998459d2bd70130.tar.gz
bcm5719-llvm-37d9a9cebf1076c246d80a0bd998459d2bd70130.zip
ARM64: disable generation of .loh directives outside MachO.
Part of PR19455. llvm-svn: 206611
-rw-r--r--llvm/lib/Target/ARM64/ARM64TargetMachine.cpp3
-rw-r--r--llvm/test/CodeGen/ARM64/collect-loh.ll6
2 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM64/ARM64TargetMachine.cpp b/llvm/lib/Target/ARM64/ARM64TargetMachine.cpp
index 946a0ee59e2..8070ce0d8b2 100644
--- a/llvm/lib/Target/ARM64/ARM64TargetMachine.cpp
+++ b/llvm/lib/Target/ARM64/ARM64TargetMachine.cpp
@@ -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;
}
diff --git a/llvm/test/CodeGen/ARM64/collect-loh.ll b/llvm/test/CodeGen/ARM64/collect-loh.ll
index 08ab0620b8b..e92690b04f8 100644
--- a/llvm/test/CodeGen/ARM64/collect-loh.ll
+++ b/llvm/test/CodeGen/ARM64/collect-loh.ll
@@ -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
OpenPOWER on IntegriCloud