[llvm-commits] CVS: llvm/lib/VMCore/Instructions.cpp

Chris Lattner sabre at nondot.org
Thu Jun 14 23:04:46 PDT 2007



Changes in directory llvm/lib/VMCore:

Instructions.cpp updated: 1.92 -> 1.93
---
Log message:

Enhance BinaryOperator::isNot to support vector not.


---
Diffs of the changes:  (+5 -1)

 Instructions.cpp |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletion(-)


Index: llvm/lib/VMCore/Instructions.cpp
diff -u llvm/lib/VMCore/Instructions.cpp:1.92 llvm/lib/VMCore/Instructions.cpp:1.93
--- llvm/lib/VMCore/Instructions.cpp:1.92	Fri May 11 16:43:24 2007
+++ llvm/lib/VMCore/Instructions.cpp	Fri Jun 15 01:04:24 2007
@@ -1404,7 +1404,11 @@
 
 // isConstantAllOnes - Helper function for several functions below
 static inline bool isConstantAllOnes(const Value *V) {
-  return isa<ConstantInt>(V) &&cast<ConstantInt>(V)->isAllOnesValue();
+  if (const ConstantInt *CI = dyn_cast<ConstantInt>(V))
+    return CI->isAllOnesValue();
+  if (const ConstantVector *CV = dyn_cast<ConstantVector>(V))
+    return CV->isAllOnesValue();
+  return false;
 }
 
 bool BinaryOperator::isNeg(const Value *V) {






More information about the llvm-commits mailing list