A splat of a vector constant of all zero or all one is the vector constant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29234 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2006-07-20 23:09:47 +00:00
parent 3c62934268
commit 1e1a88e8cc

View File

@ -2393,6 +2393,8 @@ X86TargetLowering::LowerVECTOR_SHUFFLE(SDOperand Op, SelectionDAG &DAG) {
bool V2IsUndef = V2.getOpcode() == ISD::UNDEF;
if (isSplatMask(PermMask.Val)) {
if (ISD::isBuildVectorAllZeros(V1.Val) || ISD::isBuildVectorAllOnes(V1.Val))
return V1;
if (NumElems <= 4) return Op;
// Promote it to a v4i32 splat.
return PromoteSplat(Op, DAG);