[InstCombine] combine a shuffle and an extract subvector shuffle
authorSanjay Patel <spatel@rotateright.com>
Sun, 14 Oct 2018 15:25:06 +0000 (15:25 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sun, 14 Oct 2018 15:25:06 +0000 (15:25 +0000)
commit7181146c6c45e14614b4eef8a8b5d1e91d0b2ad7
tree336ec1d12d67b6fa0de703d38aa17d965f2fb577
parent38bbf81ade2fa94018db2f0777fa19de71c78f41
[InstCombine] combine a shuffle and an extract subvector shuffle

This is part of the missing IR-level folding noted in D52912.
This should be ok as a canonicalization because the new shuffle mask can't
be any more complicated than the existing shuffle mask. If there's some
target where the shorter vector shuffle is not legal, it should just end up
expanding to something like the pair of shuffles that we're starting with here.

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

llvm-svn: 344476
llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
llvm/test/Transforms/InstCombine/vec_shuffle.ll