diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-10-31 10:01:29 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-10-31 10:01:29 +0000 |
commit | 8682ac1a778c423b7d09b6f0a5837fd6cd1c9d17 (patch) | |
tree | 41da85c80862f822c1cfa3d3fd29e335344ce065 /llvm/lib/Transforms/Utils/LCSSA.cpp | |
parent | ef94169938c94fbe521f783de776390cf9cd17d8 (diff) | |
download | bcm5719-llvm-8682ac1a778c423b7d09b6f0a5837fd6cd1c9d17.tar.gz bcm5719-llvm-8682ac1a778c423b7d09b6f0a5837fd6cd1c9d17.zip |
LCSSA: Add a workaround for another nasty SCEV cache invalidation issue.
I'm not entirely happy with this solution, but I don't see a smarter way currently.
Fixes PR14214.
llvm-svn: 167112
Diffstat (limited to 'llvm/lib/Transforms/Utils/LCSSA.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LCSSA.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/LCSSA.cpp b/llvm/lib/Transforms/Utils/LCSSA.cpp index 833dea54713..38c1495fac3 100644 --- a/llvm/lib/Transforms/Utils/LCSSA.cpp +++ b/llvm/lib/Transforms/Utils/LCSSA.cpp @@ -255,6 +255,11 @@ bool LCSSA::ProcessInstruction(Instruction *Inst, if (Loop *L = LI->getLoopFor(ExitBB)) SE->forgetLoop(L); } + + // If we added a PHI, drop the cache to avoid invalidating SCEV caches. + // FIXME: This is a big hammer, can we clear the cache more selectively? + if (SE && !AddedPHIs.empty()) + SE->forgetLoop(L); // Rewrite all uses outside the loop in terms of the new PHIs we just // inserted. |