mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-03 01:12:53 +00:00
[LoopUnroll] Fix potentially incorrect SCEV invalidation in UnrollRuntime
Current runtime unrolling invalidates parent loop saying that it might have changed after the inner loop has changed, but it doesn't bother to do the same to its parents. With patch rL329047, SCEV becomes much smarter about calculation of exit counts for outer loops. We might need to invalidate not only the immediate parent, but also any of its parents as well. There is no clear evidence that there is some miscompile happening because of this (at least I don't have such test), but the common sense says that the current code is wrong. Differential Revision: https://reviews.llvm.org/D45940 Reviewed By: chandlerc git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330577 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d356fd6732
commit
b66694ab52
@ -878,10 +878,9 @@ bool llvm::UnrollRuntimeLoopRemainder(Loop *L, unsigned Count,
|
||||
NewPreHeader, VMap, DT, LI, PreserveLCSSA);
|
||||
}
|
||||
|
||||
// If this loop is nested, then the loop unroller changes the code in the
|
||||
// parent loop, so the Scalar Evolution pass needs to be run again.
|
||||
if (Loop *ParentLoop = L->getParentLoop())
|
||||
SE->forgetLoop(ParentLoop);
|
||||
// If this loop is nested, then the loop unroller changes the code in the any
|
||||
// of its parent loops, so the Scalar Evolution pass needs to be run again.
|
||||
SE->forgetTopmostLoop(L);
|
||||
|
||||
// Canonicalize to LoopSimplifyForm both original and remainder loops. We
|
||||
// cannot rely on the LoopUnrollPass to do this because it only does
|
||||
|
Loading…
Reference in New Issue
Block a user