Enhance BinaryOperator::isNot to support vector not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37585 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2007-06-15 06:04:24 +00:00
parent 003b6200df
commit e20b7bec02

View File

@ -1404,7 +1404,11 @@ BinaryOperator *BinaryOperator::createNot(Value *Op, const std::string &Name,
// 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) {