]> granicus.if.org Git - llvm/commit
[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)
commit090f6c5b1319c9073064505c8981c2cbfd557339
tree926c6ad12f9f15d79ca9b830b9eecc0e2f36104a
parentaeb864ee776312ca3496021587b57d8483047305
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371340 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineVectorOps.cpp
test/Transforms/InstCombine/insert-extract-shuffle.ll