[LV] Add SCEV workaround from 80e8025 to epilogue vector code path.
This was exposed by14e3650f. The recommit of14e3650fwill hit the problematic code path requiring the workaround. test case that crashes without the workaround.
This commit is contained in:
@@ -7741,6 +7741,15 @@ Value *InnerLoopUnroller::getBroadcastInstrs(Value *V) { return V; }
|
||||
std::pair<BasicBlock *, Value *>
|
||||
EpilogueVectorizerMainLoop::createEpilogueVectorizedLoopSkeleton() {
|
||||
MDNode *OrigLoopID = OrigLoop->getLoopID();
|
||||
|
||||
// Workaround! Compute the trip count of the original loop and cache it
|
||||
// before we start modifying the CFG. This code has a systemic problem
|
||||
// wherein it tries to run analysis over partially constructed IR; this is
|
||||
// wrong, and not simply for SCEV. The trip count of the original loop
|
||||
// simply happens to be prone to hitting this in practice. In theory, we
|
||||
// can hit the same issue for any SCEV, or ValueTracking query done during
|
||||
// mutation. See PR49900.
|
||||
getOrCreateTripCount(OrigLoop->getLoopPreheader());
|
||||
Loop *Lp = createVectorLoopSkeleton("");
|
||||
|
||||
// Generate the code to check the minimum iteration count of the vector
|
||||
|
||||
Reference in New Issue
Block a user