aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Utils
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-10-31 10:01:29 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-10-31 10:01:29 +0000
commit4ad3d981b91ac1293b8f2be29e6452d5206107b8 (patch)
treea46424493dbc6d8e6e735e80580ef0a56a0250a5 /lib/Transforms/Utils
parent0ceb855d5251c67c3a129c172a520c1d2682c344 (diff)
downloadexternal_llvm-4ad3d981b91ac1293b8f2be29e6452d5206107b8.zip
external_llvm-4ad3d981b91ac1293b8f2be29e6452d5206107b8.tar.gz
external_llvm-4ad3d981b91ac1293b8f2be29e6452d5206107b8.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167112 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils')
-rw-r--r--lib/Transforms/Utils/LCSSA.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Transforms/Utils/LCSSA.cpp b/lib/Transforms/Utils/LCSSA.cpp
index 833dea5..38c1495 100644
--- a/lib/Transforms/Utils/LCSSA.cpp
+++ b/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.