[PATCH] D98222: [SCEV] Use trip count information to improve shift recurrence ranges
Philip Reames via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 12 14:15:33 PST 2021
reames added inline comments.
================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:5655
+ if (!L || L->getHeader() != P->getParent())
+ return CR;
+
----------------
reames wrote:
> mkazantsev wrote:
> > `LI.isLoopHeader(P->getParent())`?
> > I also wonder why is that needed. The implementation of `matchSimpleRecurrence` cannot recognize something which is not a header phi, because there is no other way to have BO as operand of Phi and vice versa at the same time. I guess this may be turned into assert after `matchSimpleRecurrence`.
> You're right, this can become an assert. It made since before some refactoring I did to the code before commit. Not so much anymore. Will fix.
Hm, funny story. It turns out this needs to be a bail out after all. Not because it should be, but because asserting it exposes a bug in LoopFusion. I'm putting a careful comment in the code and have filed PR49566 to track the issue.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D98222/new/
https://reviews.llvm.org/D98222
More information about the llvm-commits
mailing list