OSDN Git Service

[InstCombine] canonicalize insert+splat to/from element 0 of vector
authorSanjay Patel <spatel@rotateright.com>
Mon, 8 Jul 2019 16:26:48 +0000 (16:26 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 8 Jul 2019 16:26:48 +0000 (16:26 +0000)
commitea3ab8c4b7cfd025f0748dc980572dbf1886bd6e
tree4ba9036bbe2e8b626848cd9021b3eeb0784e438f
parentbb7d03ce5b3ce38e4de3b784961428957d73ea03
[InstCombine] canonicalize insert+splat to/from element 0 of vector

We recognize a splat from element 0 in (VectorUtils) llvm::getSplatValue()
and also in ShuffleVectorInst::isZeroEltSplatMask(), so this converts
to that form for better matching.

The backend generically turns these patterns into build_vector,
so there should be no codegen difference.

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