[llvm-commits] [llvm] r64335 - /llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp

Nate Begeman natebegeman at mac.com
Wed Feb 11 14:36:25 PST 2009


Author: sampo
Date: Wed Feb 11 16:36:25 2009
New Revision: 64335

URL: http://llvm.org/viewvc/llvm-project?rev=64335&view=rev
Log:
the two non-mask arguments to a shufflevector must be the same width, but they do not have to be the same
width as the result value.

Modified:
    llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=64335&r1=64334&r2=64335&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Wed Feb 11 16:36:25 2009
@@ -1538,11 +1538,12 @@
       }
     }
 
+    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 @@
       if (MaskVal == -1u) {
         UndefElts.set(i);
       } else if (MaskVal < LHSVWidth) {
-        if (UndefElts2[MaskVal]) {
+        if (UndefElts4[MaskVal]) {
           NewUndefElts = true;
           UndefElts.set(i);
         }





More information about the llvm-commits mailing list