1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00

[InstSimplify] Use APInt::isMask isntead of manually implementing it. NFC

llvm-svn: 303968
This commit is contained in:
Craig Topper 2017-05-26 05:16:22 +00:00
parent b024a5fecb
commit a70185a2f6

View File

@ -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 &&