summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-04-20 22:20:12 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-04-20 22:20:12 +0000
commit5f1ba4cd2de8a82f6fe2e42b7fef46a8e055c46b (patch)
tree8083f34a93a031d276986ba25288e4af6efe7135 /llvm
parent86e53ced08beca7b2333e7c0a52427eae5b2499e (diff)
downloadbcm5719-llvm-5f1ba4cd2de8a82f6fe2e42b7fef46a8e055c46b.tar.gz
bcm5719-llvm-5f1ba4cd2de8a82f6fe2e42b7fef46a8e055c46b.zip
Remove -use-divmod-libcall. Let targets opt in when they are available.
llvm-svn: 129884
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Target/TargetOptions.h4
-rw-r--r--llvm/lib/Target/ARM/ARMISelLowering.cpp3
-rw-r--r--llvm/lib/Target/ARM/ARMSubtarget.h2
-rw-r--r--llvm/lib/Target/TargetMachine.cpp5
-rw-r--r--llvm/test/CodeGen/ARM/divmod.ll2
5 files changed, 5 insertions, 11 deletions
diff --git a/llvm/include/llvm/Target/TargetOptions.h b/llvm/include/llvm/Target/TargetOptions.h
index cea8d5d8a2d..62190c166e3 100644
--- a/llvm/include/llvm/Target/TargetOptions.h
+++ b/llvm/include/llvm/Target/TargetOptions.h
@@ -157,10 +157,6 @@ namespace llvm {
/// wth earlier copy coalescing.
extern bool StrongPHIElim;
- /// HasDivModLibcall - This flag indicates whether the target compiler
- /// runtime library has integer divmod libcalls.
- extern bool HasDivModLibcall;
-
/// getTrapFunctionName - If this returns a non-empty string, this means isel
/// should lower Intrinsic::trap to a call to the specified function name
/// instead of an ISD::TRAP node.
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
index 50dd4091070..2d555cd7828 100644
--- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -398,7 +398,8 @@ ARMTargetLowering::ARMTargetLowering(TargetMachine &TM)
setLibcallCallingConv(RTLIB::UDIV_I32, CallingConv::ARM_AAPCS);
}
- if (HasDivModLibcall) {
+ // Use divmod iOS compiler-rt calls.
+ if (Subtarget->getTargetTriple().getOS() == Triple::IOS) {
setLibcallName(RTLIB::SDIVREM_I32, "__divmodsi4");
setLibcallName(RTLIB::UDIVREM_I32, "__udivmodsi4");
}
diff --git a/llvm/lib/Target/ARM/ARMSubtarget.h b/llvm/lib/Target/ARM/ARMSubtarget.h
index f880bc958fe..0271c873f19 100644
--- a/llvm/lib/Target/ARM/ARMSubtarget.h
+++ b/llvm/lib/Target/ARM/ARMSubtarget.h
@@ -201,6 +201,8 @@ protected:
bool hasFP16() const { return HasFP16; }
bool hasD16() const { return HasD16; }
+ const Triple &getTargetTriple() const { return TargetTriple; }
+
bool isTargetDarwin() const { return TargetTriple.isOSDarwin(); }
bool isTargetELF() const { return !isTargetDarwin(); }
diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp
index 93eae250dfc..4a1ac94826f 100644
--- a/llvm/lib/Target/TargetMachine.cpp
+++ b/llvm/lib/Target/TargetMachine.cpp
@@ -206,11 +206,6 @@ EnableStrongPHIElim(cl::Hidden, "strong-phi-elim",
cl::desc("Use strong PHI elimination."),
cl::location(StrongPHIElim),
cl::init(false));
-static cl::opt<bool, true>
-UseDivMod("use-divmod-libcall",
- cl::desc("Use __{u}divmod libcalls for div / rem pairs"),
- cl::location(HasDivModLibcall),
- cl::init(false));
static cl::opt<std::string>
TrapFuncName("trap-func", cl::Hidden,
cl::desc("Emit a call to trap function rather than a trap instruction"),
diff --git a/llvm/test/CodeGen/ARM/divmod.ll b/llvm/test/CodeGen/ARM/divmod.ll
index 9c90a8296bd..34313aa89aa 100644
--- a/llvm/test/CodeGen/ARM/divmod.ll
+++ b/llvm/test/CodeGen/ARM/divmod.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=arm-apple-darwin -use-divmod-libcall | FileCheck %s
+; RUN: llc < %s -mtriple=arm-apple-ios | FileCheck %s
define void @foo(i32 %x, i32 %y, i32* nocapture %P) nounwind ssp {
entry:
OpenPOWER on IntegriCloud