diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index d2cef4bc0b8..95c1850089f 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -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(GEPI->getOperand(0))) { Constant *C = dyn_cast(GEPI->getOperand(0));