[PATCH] D33316: [SCEV] Do not fold expressions with SCEVUnknown Phis into AddRecExpr's
Max Kazantsev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 18 23:44:13 PDT 2017
mkazantsev added inline comments.
================
Comment at: lib/Analysis/ScalarEvolution.cpp:2210
+ auto *SU = dyn_cast<SCEVUnknown>(S);
+ if (auto *Phi = dyn_cast<PHINode>(SU->getValue()))
+ if (auto *PL = LI.getLoopFor(Phi->getParent()))
----------------
sanjoy wrote:
> I'm not sure why this can't happen with non-PHIs. IMO the condition should be "the expression the SCEVUnknown corresponds to must dominate L->getHeader()".
Good point, the same situation could happen if we applied non-SCEVable operation with our Phi.
https://reviews.llvm.org/D33316
More information about the llvm-commits
mailing list