From 56434b7578255ea7a5f2dc3238530340008bb2e2 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Thu, 20 Jul 2006 23:09:47 +0000 Subject: [PATCH] A splat of a vector constant of all zero or all one is the vector constant. llvm-svn: 29234 --- lib/Target/X86/X86ISelLowering.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 4ebe4caad09..2ae607c182c 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -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);