[PATCH] D91325: [IndVarSimplify] Notify top most loop to drop cached exit counts
guopeilin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 16 20:13:05 PST 2020
guopeilin updated this revision to Diff 305645.
guopeilin retitled this revision from "[IndVarSimplify] Drop any stored trip count value before IndVarSimplify" to "[IndVarSimplify] Notify top most loop to drop cached exit counts".
guopeilin added a comment.
use forgetTopmostLoop() directly instead of visiting exitingBB among nested loops
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91325/new/
https://reviews.llvm.org/D91325
Files:
llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -1786,7 +1786,9 @@
if (predicateLoopExits(L, Rewriter)) {
Changed = true;
// Given we've changed exit counts, notify SCEV
- SE->forgetLoop(L);
+ // Some nested loops may share same folded exit basic block,
+ // thus we need to notify top most loop.
+ SE->forgetTopmostLoop(L);
}
// If we have a trip count expression, rewrite the loop's exit condition
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91325.305645.patch
Type: text/x-patch
Size: 609 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201117/8479db6f/attachment.bin>
More information about the llvm-commits
mailing list