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

Chris Lattner lattner at cs.uiuc.edu
Fri Jan 6 10:00:11 PST 2006



Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.409 -> 1.410
---
Log message:

silence some bogus gcc warnings on fenris


---
Diffs of the changes:  (+11 -10)

 InstructionCombining.cpp |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.409 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.410
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.409	Fri Jan  6 01:52:12 2006
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Fri Jan  6 11:59:59 2006
@@ -721,8 +721,8 @@
       if (Instruction *NV = FoldOpIntoPhi(I))
         return NV;
     
-    ConstantInt *XorRHS;
-    Value *XorLHS;
+    ConstantInt *XorRHS = 0;
+    Value *XorLHS = 0;
     if (match(LHS, m_Xor(m_Value(XorLHS), m_ConstantInt(XorRHS)))) {
       unsigned TySizeBits = I.getType()->getPrimitiveSizeInBits();
       int64_t  RHSSExt = cast<ConstantInt>(RHSC)->getSExtValue();
@@ -821,7 +821,7 @@
     if (Instruction *R = AssociativeOpt(I, AddMaskingAnd(C2))) return R;
 
   if (ConstantInt *CRHS = dyn_cast<ConstantInt>(RHS)) {
-    Value *X;
+    Value *X = 0;
     if (match(LHS, m_Not(m_Value(X)))) {   // ~X + C --> (C-1) - X
       Constant *C= ConstantExpr::getSub(CRHS, ConstantInt::get(I.getType(), 1));
       return BinaryOperator::createSub(C, X);
@@ -1772,7 +1772,7 @@
     // calling MaskedValueIsZero, to avoid inefficient cases where we traipse
     // through many levels of ands.
     {
-      Value *X; ConstantInt *C1;
+      Value *X = 0; ConstantInt *C1 = 0;
       if (match(Op0, m_And(m_Value(X), m_ConstantInt(C1))))
         return BinaryOperator::createAnd(X, ConstantExpr::getAnd(C1, AndRHS));
     }
@@ -2076,7 +2076,7 @@
                           cast<ConstantIntegral>(ConstantExpr::getNot(RHS))))
       return ReplaceInstUsesWith(I, RHS);
 
-    ConstantInt *C1; Value *X;
+    ConstantInt *C1 = 0; Value *X = 0;
     // (X & C1) | C2 --> (X | C2) & (C1|C2)
     if (match(Op0, m_And(m_Value(X), m_ConstantInt(C1))) && isOnlyUse(Op0)) {
       Instruction *Or = BinaryOperator::createOr(X, RHS, Op0->getName());
@@ -2103,7 +2103,8 @@
         return NV;
   }
 
-  Value *A, *B; ConstantInt *C1, *C2;
+  Value *A = 0, *B = 0;
+  ConstantInt *C1 = 0, *C2 = 0;
 
   if (match(Op0, m_And(m_Value(A), m_Value(B))))
     if (A == Op1 || B == Op1)    // (A & ?) | A  --> A
@@ -2140,7 +2141,7 @@
     // .. and C2 = ~C1 and C2 is 0+1+ and (N & C2) == 0
     // replace with V+N.
     if (C1 == ConstantExpr::getNot(C2)) {
-      Value *V1, *V2;
+      Value *V1 = 0, *V2 = 0;
       if ((C2->getRawValue() & (C2->getRawValue()+1)) == 0 && // C2 == 0+1+
           match(A, m_Add(m_Value(V1), m_Value(V2)))) {
         // Add commutes, try both ways.
@@ -2415,9 +2416,9 @@
     }
 
   // (A & C1)^(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0
-  Value *A, *B; ConstantInt *C1, *C2;
-  if (match(Op0, m_And(m_Value(A), m_ConstantInt(C1))) &&
-      match(Op1, m_And(m_Value(B), m_ConstantInt(C2))) &&
+  ConstantInt *C1 = 0, *C2 = 0;
+  if (match(Op0, m_And(m_Value(), m_ConstantInt(C1))) &&
+      match(Op1, m_And(m_Value(), m_ConstantInt(C2))) &&
       ConstantExpr::getAnd(C1, C2)->isNullValue())
     return BinaryOperator::createOr(Op0, Op1);
 






More information about the llvm-commits mailing list