This is an archive of the discontinued LLVM Phabricator instance.

[SLP]Fix insertpoint of the extractellements instructions to avoid reshuffle crash.
ClosedPublic

Authored by ABataev on Oct 10 2022, 8:27 AM.

Details

Summary

Need to set the insertpoint for extractelement to point to the first
instruction in the node to avoid possible crash during external uses
combine process. Without it we may endup with the incorrect
transformation.

Diff Detail

Event Timeline

ABataev created this revision.Oct 10 2022, 8:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 10 2022, 8:27 AM
ABataev requested review of this revision.Oct 10 2022, 8:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 10 2022, 8:27 AM
RKSimon added inline comments.
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
7696

At what point when extending a capture list should we just use [&]? @dblaikie was commenting on this not so long ago.

ABataev added inline comments.Oct 10 2022, 9:16 AM
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
7696

I don't see any rules related to the list of captures in LLVM coding standard https://llvm.org/docs/CodingStandards.html

RKSimon accepted this revision.Oct 12 2022, 6:26 AM

LGTM

llvm/test/Transforms/SLPVectorizer/X86/extractelement-insertpoint.ll
30

maybe cleanup these variable names?

This revision is now accepted and ready to land.Oct 12 2022, 6:26 AM