This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] allow undef elements when forming splat from chain of insertelements
ClosedPublic

Authored by spatel on Jun 26 2019, 3:46 PM.

Details

Summary

We allow forming a splat (broadcast) shuffle, but we were conservatively limiting that to cases where all elements of the vector are specified. It should be safe from a codegen perspective to allow undefined lanes of the vector because the expansion of a splat shuffle would become the chain of inserts again.

Forming splat shuffles can reduce IR and help enable further IR transforms. Motivating bugs:
https://bugs.llvm.org/show_bug.cgi?id=42174
https://bugs.llvm.org/show_bug.cgi?id=16739 (this one needs a lot of changes, and I'm still not sure how to fix it)

Diff Detail

Event Timeline

spatel created this revision.Jun 26 2019, 3:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 26 2019, 3:46 PM
RKSimon accepted this revision.Jul 2 2019, 7:07 AM

LGTM - cheers

This revision is now accepted and ready to land.Jul 2 2019, 7:07 AM
This revision was automatically updated to reflect the committed changes.