A splat of a vector constant of all zero or all one is the vector constant.
authorEvan Cheng <evan.cheng@apple.com>
Thu, 20 Jul 2006 23:09:47 +0000 (23:09 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 20 Jul 2006 23:09:47 +0000 (23:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29234 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelLowering.cpp

index 4ebe4caad098a203e07541c3d3cb4e002ea8f2e1..2ae607c182c06d513a2467bcbe9e4d5285a7d5ac 100644 (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);