summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-03-30 22:21:16 +0000
committerCraig Topper <craig.topper@gmail.com>2017-03-30 22:21:16 +0000
commit3a40a397c32ba2b7a2a12d065f4a9db7bdca15e0 (patch)
tree26008ca2a1f7023a5e4ec4dd2a487c3c704ec9aa /llvm/lib
parent6856d341a82153ba1933ddcbb786130cf3fa3a12 (diff)
downloadbcm5719-llvm-3a40a397c32ba2b7a2a12d065f4a9db7bdca15e0.tar.gz
bcm5719-llvm-3a40a397c32ba2b7a2a12d065f4a9db7bdca15e0.zip
[InstSimplify] Use m_SignBit instead of calling getSignBit and using m_Specific. NFCI
llvm-svn: 299121
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/InstructionSimplify.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp
index dace55a1c09..29c0d0afe31 100644
--- a/llvm/lib/Analysis/InstructionSimplify.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud