My previous patch was too conservative. Reject FP and void types, but do
[oota-llvm.git] / lib / Transforms / Scalar / LoopStrengthReduce.cpp
index 183362dc0e601b32a38a67cb3a75a0d1ff926834..4f18637c9f634dac71877dd9c34c4dca44d3fe54 100644 (file)
@@ -372,7 +372,8 @@ 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()->isInteger()) return false;
+  if (!I->getType()->isInteger() && !isa<PointerType>(I->getType()))
+      return false;   // Void and FP expressions cannot be reduced.
   if (!Processed.insert(I).second)
     return true;    // Instruction already handled.