Remove -use-divmod-libcall. Let targets opt in when they are available.
authorEvan Cheng <evan.cheng@apple.com>
Wed, 20 Apr 2011 22:20:12 +0000 (22:20 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Wed, 20 Apr 2011 22:20:12 +0000 (22:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129884 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetOptions.h
lib/Target/ARM/ARMISelLowering.cpp
lib/Target/ARM/ARMSubtarget.h
lib/Target/TargetMachine.cpp
test/CodeGen/ARM/divmod.ll

index cea8d5d8a2d53b2f510d09c83af57c476ad9613d..62190c166e3f27adc769234ed4d2591f4b929571 100644 (file)
@@ -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.
index 50dd4091070739689715c6edaf5b4c7df942be09..2d555cd7828c2baece9ca74229d67e77e4952f29 100644 (file)
@@ -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");
   }
index f880bc958feee366e926a15f94daa618012cd054..0271c873f191a92942c00925f408e9230d3b8689 100644 (file)
@@ -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(); }
 
index 93eae250dfc7d4dfa62f7b8ccc7b75aca95bbd2c..4a1ac94826f3d496ef7a592e81ee57c527ecbec2 100644 (file)
@@ -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"),
index 9c90a8296bd2c3232becbda03e103d548616b7dc..34313aa89aaec45dc3b092b5f8336c591c178f46 100644 (file)
@@ -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: