From: Craig Topper Date: Thu, 30 Mar 2017 22:21:16 +0000 (+0000) Subject: [InstSimplify] Use m_SignBit instead of calling getSignBit and using m_Specific.... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=83c5596f48ceef40c53b2ce0ff5ac5ddf6980cfa;p=llvm [InstSimplify] Use m_SignBit instead of calling getSignBit and using m_Specific. NFCI git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299121 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/InstructionSimplify.cpp b/lib/Analysis/InstructionSimplify.cpp index dace55a1c09..29c0d0afe31 100644 --- a/lib/Analysis/InstructionSimplify.cpp +++ b/lib/Analysis/InstructionSimplify.cpp @@ -565,10 +565,8 @@ static Value *SimplifyAddInst(Value *Op0, Value *Op1, bool isNSW, bool isNUW, // add nsw/nuw (xor Y, signbit), signbit --> Y // The no-wrapping add guarantees that the top bit will be set by the add. // Therefore, the xor must be clearing the already set sign bit of Y. - Constant *SignBit = - ConstantInt::get(Ty, APInt::getSignBit(Ty->getScalarSizeInBits())); - if ((isNSW || isNUW) && match(Op1, m_Specific(SignBit)) && - match(Op0, m_Xor(m_Value(Y), m_Specific(SignBit)))) + if ((isNSW || isNUW) && match(Op1, m_SignBit()) && + match(Op0, m_Xor(m_Value(Y), m_SignBit()))) return Y; /// i1 add -> xor.