the two non-mask arguments to a shufflevector must be the same width, but they do...
authorNate Begeman <natebegeman@mac.com>
Wed, 11 Feb 2009 22:36:25 +0000 (22:36 +0000)
committerNate Begeman <natebegeman@mac.com>
Wed, 11 Feb 2009 22:36:25 +0000 (22:36 +0000)
width as the result value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64335 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/InstructionCombining.cpp

index b4262743a3cac3b10d862b0eb330ee135e5f7eb4..7117bda7067565e59c901dc457a43ef723859ba7 100644 (file)
@@ -1538,11 +1538,12 @@ Value *InstCombiner::SimplifyDemandedVectorElts(Value *V, APInt DemandedElts,
       }
     }
 
+    APInt UndefElts4(LHSVWidth, 0);
     TmpV = SimplifyDemandedVectorElts(I->getOperand(0), LeftDemanded,
-                                      UndefElts2, Depth+1);
+                                      UndefElts4, Depth+1);
     if (TmpV) { I->setOperand(0, TmpV); MadeChange = true; }
 
-    APInt UndefElts3(VWidth, 0);
+    APInt UndefElts3(LHSVWidth, 0);
     TmpV = SimplifyDemandedVectorElts(I->getOperand(1), RightDemanded,
                                       UndefElts3, Depth+1);
     if (TmpV) { I->setOperand(1, TmpV); MadeChange = true; }
@@ -1553,7 +1554,7 @@ Value *InstCombiner::SimplifyDemandedVectorElts(Value *V, APInt DemandedElts,
       if (MaskVal == -1u) {
         UndefElts.set(i);
       } else if (MaskVal < LHSVWidth) {
-        if (UndefElts2[MaskVal]) {
+        if (UndefElts4[MaskVal]) {
           NewUndefElts = true;
           UndefElts.set(i);
         }