diff options
author | Craig Topper <craig.topper@gmail.com> | 2017-05-26 05:16:22 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2017-05-26 05:16:22 +0000 |
commit | 25d9ba9a1262fb77f91cae4096ede93c8da6991c (patch) | |
tree | ae2e1de6304f438132e44a97b1f0c42dded01637 /llvm | |
parent | 50500d505456a61672c10e4101dd35d8eee9f164 (diff) | |
download | bcm5719-llvm-25d9ba9a1262fb77f91cae4096ede93c8da6991c.tar.gz bcm5719-llvm-25d9ba9a1262fb77f91cae4096ede93c8da6991c.zip |
[InstSimplify] Use APInt::isMask isntead of manually implementing it. NFC
llvm-svn: 303968
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/Analysis/InstructionSimplify.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp index 34ca389ad21..0a7b98b959a 100644 --- a/llvm/lib/Analysis/InstructionSimplify.cpp +++ b/llvm/lib/Analysis/InstructionSimplify.cpp @@ -1931,7 +1931,7 @@ static Value *SimplifyOrInst(Value *Op0, Value *Op1, const SimplifyQuery &Q, // .. and C2 = ~C1 and C2 is 0+1+ and (N & C2) == 0 // replace with V+N. Value *V1, *V2; - if ((C2->getValue() & (C2->getValue() + 1)) == 0 && // C2 == 0+1+ + if (C2->getValue().isMask() && // C2 == 0+1+ match(A, m_Add(m_Value(V1), m_Value(V2)))) { // Add commutes, try both ways. if (V1 == B && @@ -1942,7 +1942,7 @@ static Value *SimplifyOrInst(Value *Op0, Value *Op1, const SimplifyQuery &Q, return A; } // Or commutes, try both ways. - if ((C1->getValue() & (C1->getValue() + 1)) == 0 && + if (C1->getValue().isMask() && match(B, m_Add(m_Value(V1), m_Value(V2)))) { // Add commutes, try both ways. if (V1 == A && |