From: Chris Lattner Date: Fri, 15 Jun 2007 06:04:24 +0000 (+0000) Subject: Enhance BinaryOperator::isNot to support vector not. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e20b7bec0234bad3986ff68961ebcbdaffb178ec;p=oota-llvm.git Enhance BinaryOperator::isNot to support vector not. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37585 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index 92f5486eaac..acb2e35be5e 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -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(V) &&cast(V)->isAllOnesValue(); + if (const ConstantInt *CI = dyn_cast(V)) + return CI->isAllOnesValue(); + if (const ConstantVector *CV = dyn_cast(V)) + return CV->isAllOnesValue(); + return false; } bool BinaryOperator::isNeg(const Value *V) {