Do NOT touch FP ops with LSR. This fixes a testcase Nate sent me from an
authorChris Lattner <sabre@nondot.org>
Thu, 20 Oct 2005 04:47:10 +0000 (04:47 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 20 Oct 2005 04:47:10 +0000 (04:47 +0000)
inner loop like this:

LBB_RateConvertMono8AltiVec_2:  ; no_exit
        lis r2, ha16(.CPI_RateConvertMono8AltiVec_0)
        lfs f3, lo16(.CPI_RateConvertMono8AltiVec_0)(r2)
        fmr f3, f3
        fadd f0, f2, f0
        fadd f3, f0, f3
        fcmpu cr0, f3, f1
        bge cr0, LBB_RateConvertMono8AltiVec_2  ; no_exit

to an inner loop like this:

LBB_RateConvertMono8AltiVec_1:  ; no_exit
        fsub f2, f2, f1
        fcmpu cr0, f2, f1
        fmr f0, f2
        bge cr0, LBB_RateConvertMono8AltiVec_1  ; no_exit

Doh! good catch!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23838 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopStrengthReduce.cpp

index a74b91b4f760cc546ccc7ea07ff868d416d7c0aa..183362dc0e601b32a38a67cb3a75a0d1ff926834 100644 (file)
@@ -372,7 +372,7 @@ static bool IVUseShouldUsePostIncValue(Instruction *User, Instruction *IV,
 /// return true.  Otherwise, return false.
 bool LoopStrengthReduce::AddUsersIfInteresting(Instruction *I, Loop *L,
                                             std::set<Instruction*> &Processed) {
-  if (I->getType() == Type::VoidTy) return false;
+  if (!I->getType()->isInteger()) return false;
   if (!Processed.insert(I).second)
     return true;    // Instruction already handled.