This is an archive of the discontinued LLVM Phabricator instance.

[DAG] Fold shuffle(bop(shuffle(x,y),shuffle(z,w)),undef) -> bop(shuffle'(x,y),shuffle'(z,w)
ClosedPublic

Authored by RKSimon on Mar 15 2021, 11:03 AM.

Details

Summary

Followup to D96345, handle unary shuffles of binops (as well as binary shuffles) if we can merge the shuffle with inner operand shuffles.

Diff Detail

Event Timeline

RKSimon created this revision.Mar 15 2021, 11:03 AM
RKSimon requested review of this revision.Mar 15 2021, 11:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 15 2021, 11:03 AM

any comments?

pengfei accepted this revision.Mar 19 2021, 4:43 AM

I had a check on the tests, the changes should all be correct. LGTM.

llvm/test/CodeGen/X86/haddsub-shuf.ll
524

Though it's not related to this change, but should it be vphaddd %xmm1, %xmm1, %xmm1?

This revision is now accepted and ready to land.Mar 19 2021, 4:43 AM
pengfei added inline comments.Mar 19 2021, 5:07 AM
llvm/test/CodeGen/X86/haddsub-shuf.ll
524

It's correct. Sorry for the noise.

RKSimon added inline comments.Mar 19 2021, 6:35 AM
llvm/test/CodeGen/X86/haddsub-shuf.ll
524

No worries - thanks for the review!

This revision was landed with ongoing or failed builds.Mar 19 2021, 7:15 AM
This revision was automatically updated to reflect the committed changes.