Changes in directory llvm/lib/Transforms/Scalar:

SCCP.cpp updated: 1.146 -> 1.147
---
Log message:

Enable a couple xforms for packed vectors (undef | v) -> -1 for packed.


---
Diffs of the changes:  (+9 -8)

 SCCP.cpp |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)


Index: llvm/lib/Transforms/Scalar/SCCP.cpp
diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.146 
llvm/lib/Transforms/Scalar/SCCP.cpp:1.147
--- llvm/lib/Transforms/Scalar/SCCP.cpp:1.146   Tue Jan  2 18:11:03 2007
+++ llvm/lib/Transforms/Scalar/SCCP.cpp Wed Jan  3 20:12:40 2007
@@ -700,9 +700,10 @@
           // Could annihilate value.
           if (I.getOpcode() == Instruction::And)
             markConstant(IV, &I, Constant::getNullValue(I.getType()));
-          else if (Constant *Ones = ConstantInt::getAllOnesValue(I.getType())) 
{
-            markConstant(IV, &I, Ones);
-          }
+          else if (const PackedType *PT = dyn_cast<PackedType>(I.getType()))
+            markConstant(IV, &I, ConstantPacked::getAllOnesValue(PT));
+          else
+            markConstant(IV, &I, ConstantInt::getAllOnesValue(I.getType()));
           return;
         } else {
           if (I.getOpcode() == Instruction::And) {
@@ -1233,11 +1234,11 @@
 
       case Instruction::Or:
         // undef | X -> -1.   X could be -1.
-        if (Constant *Ones = ConstantInt::getAllOnesValue(ITy)) {
-          markForcedConstant(LV, I, Ones);
-          return true;
-        }
-        break;
+        if (const PackedType *PTy = dyn_cast<PackedType>(ITy))
+          markForcedConstant(LV, I, ConstantPacked::getAllOnesValue(PTy));
+        else          
+          markForcedConstant(LV, I, ConstantInt::getAllOnesValue(ITy));
+        return true;
 
       case Instruction::SDiv:
       case Instruction::UDiv:



_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to