PPC32 cannot form counter loops around i64 FP conversions
[oota-llvm.git] / lib / Target / PowerPC / PPCCTRLoops.cpp
index ae5d9184605e1ba90886fb7afd208afc007b0e06..6bbd571894d907596b8233aa0e5b2bf87d61541c 100644 (file)
@@ -305,7 +305,11 @@ bool PPCCTRLoops::convertToCTRLoop(Loop *L) {
                  isa<FPToUIInst>(J) || isa<FPToSIInst>(J)) {
         CastInst *CI = cast<CastInst>(J);
         if (CI->getSrcTy()->getScalarType()->isPPC_FP128Ty() ||
-            CI->getDestTy()->getScalarType()->isPPC_FP128Ty())
+            CI->getDestTy()->getScalarType()->isPPC_FP128Ty() ||
+            (TT.isArch32Bit() &&
+             (CI->getSrcTy()->getScalarType()->isIntegerTy(64) ||
+              CI->getDestTy()->getScalarType()->isIntegerTy(64))
+            ))
           return MadeChange;
       } else if (isa<IndirectBrInst>(J) || isa<InvokeInst>(J)) {
         // On PowerPC, indirect jumps use the counter register.