[InstCombine] fold extract+insert into identity shuffle
authorSanjay Patel <spatel@rotateright.com>
Sun, 8 Sep 2019 19:03:01 +0000 (19:03 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sun, 8 Sep 2019 19:03:01 +0000 (19:03 +0000)
commitaff5bee35fb36897dd5414a52c11c14d2f858822
tree2c0b874fd98dadd3ad96115b065ef73bf885d91a
parent64965430db5706a0b235d52663f1fa466b53eed8
[InstCombine] fold extract+insert into identity shuffle

This is similar to the existing fold for splats added with:
rL365379

If we can adjust the shuffle mask to include another element
in an identity mask (if it changes vector length, that's an
extract/insert subvector operation in the backend), then that
can eliminate extractelement/insertelement pairs in IR.

All targets are expected to lower shuffles with identity masks
efficiently.

llvm-svn: 371340
llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
llvm/test/Transforms/InstCombine/insert-extract-shuffle.ll