This is an archive of the discontinued LLVM Phabricator instance.

[SLP] Fix insert point for reused extract instructions.
ClosedPublic

Authored by ABataev on Aug 1 2018, 7:00 AM.

Details

Summary

Reworked the previously committed patch to insert shuffles for reused
extract element instructions in the correct position. Previous logic was
incorrect, and might lead to the crash with PHIs and EH instructions.

Diff Detail

Event Timeline

ABataev created this revision.Aug 1 2018, 7:00 AM

This version makes a lot more sense. :)

lib/Transforms/Vectorize/SLPVectorizer.cpp
3112

Please add a test for the case where NeedToShuffleReuses is true and E->ReorderIndices.empty() is false.

ABataev added inline comments.Aug 7 2018, 9:51 AM
lib/Transforms/Vectorize/SLPVectorizer.cpp
3112

We already have that kind of test X86/vectorize-reorder-reuse.ll, but I'll add another one.

ABataev updated this revision to Diff 159531.Aug 7 2018, 9:53 AM

Added an extra test.

This revision is now accepted and ready to land.Aug 7 2018, 11:17 AM
This revision was automatically updated to reflect the committed changes.