This is an archive of the discontinued LLVM Phabricator instance.

[x86] try to form broadcast before widening shuffle elements
ClosedPublic

Authored by spatel on Nov 8 2018, 3:44 PM.

Details

Summary

I noticed that we weren't generating broadcasts as much I thought we would with D54271, and this is part of the problem.

Widening the shuffle elements means adding bitcasts and hiding the relationship between a splatted scalar and the vector. If we can form a broadcast, do that before going through the rest of the shuffle lowering because broadcasts should be cheap and can often be load-folded.

Diff Detail

Repository
rL LLVM

Event Timeline

spatel created this revision.Nov 8 2018, 3:44 PM
RKSimon accepted this revision.Nov 9 2018, 3:23 AM

LGTM - Generally we've tried to avoid lowering in lowerVectorShuffle directly (although lowerVectorShuffleWithVPMOV seems to have gotten in...) - but given the nature of broadcasts this looks OK

This revision is now accepted and ready to land.Nov 9 2018, 3:23 AM
This revision was automatically updated to reflect the committed changes.