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

Chris Lattner lattner at cs.uiuc.edu
Wed Apr 30 17:35:01 PDT 2003


Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.80 -> 1.81

---
Log message:

Fix another case where constexprs could cause a crash


---
Diffs of the changes:

Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.80 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.81
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.80	Wed Apr 30 17:19:10 2003
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Wed Apr 30 17:34:06 2003
@@ -197,11 +197,8 @@
     return BinaryOperator::getNotArgument(cast<BinaryOperator>(V));
 
   // Constants can be considered to be not'ed values...
-  if (ConstantIntegral *C = dyn_cast<ConstantIntegral>(V)) {
-    Constant *NC = *ConstantIntegral::getAllOnesValue(C->getType()) ^ *C;
-    assert(NC && "Couldn't constant fold an exclusive or!");
-    return NC;
-  }
+  if (ConstantIntegral *C = dyn_cast<ConstantIntegral>(V))
+    return *ConstantIntegral::getAllOnesValue(C->getType()) ^ *C;
   return 0;
 }
 





More information about the llvm-commits mailing list