[x86] instcombine more cases of insertps into a shufflevector
authorSanjay Patel <spatel@rotateright.com>
Sat, 25 Apr 2015 20:55:25 +0000 (20:55 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sat, 25 Apr 2015 20:55:25 +0000 (20:55 +0000)
commitc1d20a36fb5a6034c76a10bded21b43561ec2a3d
tree7eb0144ffd7a10362ecbb0ed9cfadd9f0bd6fe6c
parent3eb5146b3cc2c6e99943811d54f92e728c42d37b
[x86] instcombine more cases of insertps into a shufflevector

This is a follow-on to D8833 (insertps optimization when the zero mask is not used).

In this patch, we check for the case where the zmask is used, but both input vectors
to the insertps intrinsic are the same operand or the zmask overrides the destination
lane. This lets us replace the 2nd shuffle input operand with the zero vector.

Differential Revision: http://reviews.llvm.org/D9257

llvm-svn: 235810
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/test/Transforms/InstCombine/x86-insertps.ll