This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] merge shuffled vector negate and multiply
ClosedPublic

Authored by spatel on Mar 24 2022, 5:46 AM.

Details

Summary

Add the "(0 - X) --> X * -1" reverse identity to the list of alternate form binops.

We need a little hack to make the existing logic work because it does not expect to move constants from op0 to op1, but the code comment hopefully makes that clear. I don't think there are any other identities like that.

Fixes #54364 ( https://github.com/llvm/llvm-project/issues/54364 ).

Diff Detail

Event Timeline

spatel created this revision.Mar 24 2022, 5:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2022, 5:46 AM
spatel requested review of this revision.Mar 24 2022, 5:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2022, 5:46 AM
lebedev.ri accepted this revision.Mar 24 2022, 5:50 AM

Seems fine to me.

This revision is now accepted and ready to land.Mar 24 2022, 5:50 AM
This revision was landed with ongoing or failed builds.Mar 24 2022, 7:25 AM
This revision was automatically updated to reflect the committed changes.