This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] canonicalize select shuffles by commuting
ClosedPublic

Authored by spatel on Mar 29 2019, 3:15 PM.

Details

Summary

In PR41304:
https://bugs.llvm.org/show_bug.cgi?id=41304
...we have a case where we want to fold a binop of select-shuffle (blended) values.

Rather than try to match commuted variants of the pattern, we can canonicalize the shuffles and check for mask equality with commuted operands.

We don't produce arbitrary shuffle masks in instcombine, but select-shuffles are a special case that the backend is required to handle because we already canonicalize vector select to this shuffle form.

Diff Detail

Repository
rC Clang

Event Timeline

spatel created this revision.Mar 29 2019, 3:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 29 2019, 3:15 PM
This revision is now accepted and ready to land.Mar 30 2019, 4:03 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 31 2019, 8:03 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript