[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)
commit521f19f2498e867696b803eedfa4e87b53efea09
tree3c603869ee892241d7e78c7ee1e40c96cee65980
parent41bfd6bd6c2a86575a87ff91564ba609a76f067d
[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

llvm-svn: 280504
llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
llvm/test/Transforms/InstCombine/insert-const-shuf.ll