From: Chris Lattner Date: Tue, 6 Jan 2009 00:06:25 +0000 (+0000) Subject: no need to negate the APInt for 0. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b9f08a00af689eb54d25f4cec9a71899d1984f56;p=oota-llvm.git no need to negate the APInt for 0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61777 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Support/PatternMatch.h b/include/llvm/Support/PatternMatch.h index 98964eb2357..1cc59952727 100644 --- a/include/llvm/Support/PatternMatch.h +++ b/include/llvm/Support/PatternMatch.h @@ -57,7 +57,7 @@ struct constantint_ty { bool match(ITy *V) { if (const ConstantInt *CI = dyn_cast(V)) { const APInt &CIV = CI->getValue(); - if (Val > 0) + if (Val >= 0) return CIV == Val; // If Val is negative, and CI is shorter than it, truncate to the right // number of bits. If it is larger, then we have to sign extend. Just