Fix Regression/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll,
authorChris Lattner <sabre@nondot.org>
Sun, 6 Mar 2005 22:36:12 +0000 (22:36 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 6 Mar 2005 22:36:12 +0000 (22:36 +0000)
hopefully not breaking too many other things.

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

lib/Transforms/Scalar/LoopStrengthReduce.cpp

index d2cef4bc0b868df69b5ef2101c919eb2b5f86460..95c1850089ff1dd4619a723e469ba4a44e0bc633 100644 (file)
@@ -189,7 +189,7 @@ void LoopStrengthReduce::strengthReduceGEP(GetElementPtrInst *GEPI, Loop *L,
   // that it was the induction variable, and has been replaced by a constant
   // null value.  In this case, replace the GEP with a use of pointer directly.
   PHINode *NewPHI;
-  if (1) {
+  if (Cache->CachedPHINode == 0) {
     Value *PreGEP;
     if (AllConstantOperands && isa<Constant>(GEPI->getOperand(0))) {
       Constant *C = dyn_cast<Constant>(GEPI->getOperand(0));