[llvm-commits] CVS: llvm/lib/Transforms/Scalar/SCCP.cpp

Chris Lattner sabre at nondot.org
Wed Jan 3 18:12:56 PST 2007



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:






More information about the llvm-commits mailing list