Enhance BinaryOperator::isNot to support vector not.
llvm-svn: 37585
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp
index 92f5486..acb2e35 100644
--- a/llvm/lib/VMCore/Instructions.cpp
+++ b/llvm/lib/VMCore/Instructions.cpp
@@ -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) {