diff --git a/hpvm/lib/Transforms/Utils/HPVMLoopTransforms.cpp b/hpvm/lib/Transforms/Utils/HPVMLoopTransforms.cpp index bcb7211bae2f847f0d1567bd7ad7262e3aa0b96a..bceb967dc7d22d7e5dd3a97d15c541431b210c0a 100644 --- a/hpvm/lib/Transforms/Utils/HPVMLoopTransforms.cpp +++ b/hpvm/lib/Transforms/Utils/HPVMLoopTransforms.cpp @@ -1268,6 +1268,10 @@ void hpvm::unrollLoopByCount(Loop *L, LoopInfo &LI, DominatorTree &DT, hpvmUnrollLoop(L, ULO, &LI, &SE, &DT, &AC, &ORE, &TTI, _TripCount, _TripMultiple, _PreserveLCSSA); + // Without this, SE performs no extra analysis and can't determine the + // recurrence for the induction variable, needed in updateNZLoop + SE.forgetLoop(L); + if (_AllowRuntime && (_TripCount > 0)) updateNZLoop(L, LI, SE, F, _Count); }