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

Chris Lattner sabre at nondot.org
Fri Jan 30 23:26:06 PST 2009


Author: lattner
Date: Sat Jan 31 01:26:06 2009
New Revision: 63477

URL: http://llvm.org/viewvc/llvm-project?rev=63477&view=rev
Log:
minor cleanups

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=63477&r1=63476&r2=63477&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Sat Jan 31 01:26:06 2009
@@ -766,7 +766,7 @@
 /// in DemandedMask. Note also that the bitwidth of V, DemandedMask, KnownZero
 /// and KnownOne must all be the same.
 bool InstCombiner::SimplifyDemandedBits(Value *V, APInt DemandedMask,
-                                        APInt& KnownZero, APInt& KnownOne,
+                                        APInt &KnownZero, APInt &KnownOne,
                                         unsigned Depth) {
   assert(V != 0 && "Null pointer of Value???");
   assert(Depth <= 6 && "Limit Search Depth");
@@ -784,7 +784,7 @@
     return false;
   }
   
-  KnownZero.clear(); 
+  KnownZero.clear();
   KnownOne.clear();
   if (!V->hasOneUse()) {    // Other users may use these bits.
     if (Depth != 0) {       // Not at the root.
@@ -796,7 +796,7 @@
     // just set the DemandedMask to all bits.
     DemandedMask = APInt::getAllOnesValue(BitWidth);
   } else if (DemandedMask == 0) {   // Not demanding any bits from V.
-    if (V != UndefValue::get(VTy))
+    if (!isa<UndefValue>(V))
       return UpdateValueUsesWith(V, UndefValue::get(VTy));
     return false;
   } else if (Depth == 6) {        // Limit search depth.





More information about the llvm-commits mailing list