This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Extend pattern to replace shuffle's insertelement operand
ClosedPublic

Authored by piotr on Oct 22 2021, 8:17 AM.

Details

Summary

In D71220 a pattern was added to replace shuffle's insertelement operand
if inserted scalar is not demanded. The pattern was added only for
the case where the shuffle's mask size is equal to element's vector size.
However, that condition is not required because the pattern does not
change the shuffle vector size.

This patch extends the pattern to also include cases where shuffle's mask
size is not equal to element's vector size.

Diff Detail

Event Timeline

piotr created this revision.Oct 22 2021, 8:17 AM
piotr requested review of this revision.Oct 22 2021, 8:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 22 2021, 8:17 AM
foad added a comment.Oct 22 2021, 8:28 AM

Looks reasonable to me.

foad accepted this revision.Nov 2 2021, 1:22 AM
This revision is now accepted and ready to land.Nov 2 2021, 1:22 AM
lebedev.ri accepted this revision.Nov 2 2021, 1:34 AM
lebedev.ri added inline comments.
llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
2294
This revision was landed with ongoing or failed builds.Nov 3 2021, 1:44 AM
This revision was automatically updated to reflect the committed changes.