[InstCombine] fold select shuffles with shared operand together
authorSanjay Patel <spatel@rotateright.com>
Wed, 28 Sep 2022 15:22:52 +0000 (11:22 -0400)
committerSanjay Patel <spatel@rotateright.com>
Wed, 28 Sep 2022 15:56:27 +0000 (11:56 -0400)
commite239198cdbbf2689ffe2c21ea8feab5b7a4a8a02
treefc129eca9ac1982deafb56567898a65dc07fc7e4
parentd743aff7906784c054a0a7e9bc5db0011b8fe947
[InstCombine] fold select shuffles with shared operand together

We don't combine generic shuffles together in IR, but select
shuffles are a special-case because a select shuffle of a
select shuffle is just another select shuffle; codegen is
expected to efficiently lower those (select shuffles are also
the canonical form of a vector select with constant condition).
llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
llvm/test/Transforms/InstCombine/shuffle_select.ll