This is an archive of the discontinued LLVM Phabricator instance.

[SLP]Fix crash on extending scheduling region.
ClosedPublic

Authored by ABataev on Mar 12 2021, 10:35 AM.

Details

Summary

If SLP vectorizer tries to extend the scheduling region and runs out of
the budget too early, but still extends the region to the new ending
instructions (i.e., it was able to extend the region for the first
instruction in the bundle, but not for the second), the compiler need to
recalculate dependecies in full, just like if the extending was
successfull. Without it, the schedule data chunks may end up with the
wrong number of (unscheduled) dependecies and it may end up with the
incorrect function, where the vectorized instruction does not dominate
on the extractelement instruction.

Diff Detail

Event Timeline

ABataev created this revision.Mar 12 2021, 10:35 AM
ABataev requested review of this revision.Mar 12 2021, 10:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 12 2021, 10:35 AM
RKSimon added inline comments.Mar 17 2021, 9:31 AM
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
5230

We already have similar code in tryScheduleBundle - pull out as a helper function?

ABataev updated this revision to Diff 331372.Mar 17 2021, 2:12 PM

Outline common code as lambda.

This revision is now accepted and ready to land.Mar 17 2021, 5:31 PM
This revision was automatically updated to reflect the committed changes.