[llvm] r321104 - TargetLoweringBase: Fix darwinHasSinCos()

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 19 12:24:12 PST 2017


Author: matze
Date: Tue Dec 19 12:24:12 2017
New Revision: 321104

URL: http://llvm.org/viewvc/llvm-project?rev=321104&view=rev
Log:
TargetLoweringBase: Fix darwinHasSinCos()

Another followup to my refactoring in r321036: Turns out we can end up
with an x86 darwin target that is not macos (simulator triples can look
like i386-apple-ios) so we need the x86/32bit check in all cases.

Modified:
    llvm/trunk/lib/CodeGen/TargetLoweringBase.cpp

Modified: llvm/trunk/lib/CodeGen/TargetLoweringBase.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetLoweringBase.cpp?rev=321104&r1=321103&r2=321104&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/TargetLoweringBase.cpp (original)
+++ llvm/trunk/lib/CodeGen/TargetLoweringBase.cpp Tue Dec 19 12:24:12 2017
@@ -91,7 +91,10 @@ static cl::opt<unsigned> OptsizeJumpTabl
 
 static bool darwinHasSinCos(const Triple &TT) {
   assert(TT.isOSDarwin() && "should be called with darwin triple");
-  // Macos < 10.9 has no sincos_stret and we don't bother for 32bit code.
+  // Don't bother with 32 bit x86.
+  if (TT.getArch() == Triple::x86)
+    return false;
+  // Macos < 10.9 has no sincos_stret.
   if (TT.isMacOSX())
     return !TT.isMacOSXVersionLT(10, 9) && TT.isArch64Bit();
   // iOS < 7.0 has no sincos_stret.




More information about the llvm-commits mailing list