OSDN Git Service

[InsttCombine] fold insertelement of constant into shuffle with constant operand...
authorSanjay Patel <spatel@rotateright.com>
Fri, 2 Sep 2016 17:05:43 +0000 (17:05 +0000)
committerSanjay Patel <spatel@rotateright.com>
Fri, 2 Sep 2016 17:05:43 +0000 (17:05 +0000)
commitef2c8020397b8c6c7e6d2c26516dec91c584b88d
tree63f5fc5d99aac7b620ba7c8f6828a646dce0ca0f
parenta92ab030009fc1b0e589ef3c5f0cf005bedce578
[InsttCombine] fold insertelement of constant into shuffle with constant operand (PR29126)

The motivating case occurs with SSE/AVX scalar intrinsics, so this is a first step towards
shrinking that to a single shufflevector.

Note that the transform is intentionally limited to shuffles that are equivalent to vector
selects to avoid creating arbitrary shuffle masks that may not lower well.

This should solve PR29126:
https://llvm.org/bugs/show_bug.cgi?id=29126

Differential Revision: https://reviews.llvm.org/D23886

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