diff --git a/llvm/lib/Transforms/Scalar/LoopFlatten.cpp b/llvm/lib/Transforms/Scalar/LoopFlatten.cpp --- a/llvm/lib/Transforms/Scalar/LoopFlatten.cpp +++ b/llvm/lib/Transforms/Scalar/LoopFlatten.cpp @@ -786,9 +786,8 @@ } // Tell LoopInfo, SCEV and the pass manager that the inner loop has been - // deleted, and any information that have about the outer loop invalidated. + // deleted, and invalidate any outer loop information. SE->forgetLoop(FI.OuterLoop); - SE->forgetLoop(FI.InnerLoop); SE->forgetBlockAndLoopDispositions(); if (U) U->markLoopAsDeleted(*FI.InnerLoop, FI.InnerLoop->getName()); diff --git a/llvm/lib/Transforms/Scalar/LoopInterchange.cpp b/llvm/lib/Transforms/Scalar/LoopInterchange.cpp --- a/llvm/lib/Transforms/Scalar/LoopInterchange.cpp +++ b/llvm/lib/Transforms/Scalar/LoopInterchange.cpp @@ -1240,7 +1240,6 @@ // Tell SE that we move the loops around. SE->forgetLoop(NewOuter); - SE->forgetLoop(NewInner); } bool LoopInterchangeTransform::transform() {