[PATCH] D44001: [SCEV] Prove implications for SCEVUnknown Phis
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 6 12:52:26 PDT 2018
efriedma added inline comments.
================
Comment at: llvm/trunk/lib/Analysis/ScalarEvolution.cpp:9604
+ auto *Preheader = RLoop->getLoopPreheader();
+ assert(Preheader && "Loop with AddRec with no preheader?");
+ const SCEV *L1 = getSCEV(LPhi->getIncomingValueForBlock(Preheader));
----------------
mkazantsev wrote:
> efriedma wrote:
> > This assertion is triggering on the polly-AOSP buildbot: http://lab.llvm.org:8011/builders/aosp-O3-polly-before-vectorizer-unprofitable/builds/477 .
> >
> > I can try to reduce a testcase if you need it, but the assertion is pretty obviously just wrong: in general, SCEV doesn't care care whether a loop has a preheader.
> Thanks Eli, you're right, we don't actually need preheader here. I think this one should fix that: https://reviews.llvm.org/rL329379
Hmm...
That's an improvement, but ScalarEvolution::createAddRecFromPHI is still much more generous than your assertions: it handles loops with multiple predecessors and multiple latches, at least in some cases.
Repository:
rL LLVM
https://reviews.llvm.org/D44001
More information about the llvm-commits
mailing list