diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 44ac0dbf45bbd..0e378f5249b5a 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -924,7 +924,7 @@ getKnownBitsFromAndXorOr(const Operator *I, const APInt &DemandedElts, // Demanded) == (xor(x, x-1) & Demanded). Extend the xor pattern // to use arbitrary C if xor(x, x-C) as the same as xor(x, x-1). if (HasKnownOne && - match(I, m_c_Xor(m_Value(X), m_c_Add(m_Deferred(X), m_AllOnes())))) { + match(I, m_c_Xor(m_Value(X), m_Add(m_Deferred(X), m_AllOnes())))) { const KnownBits &XBits = I->getOperand(0) == X ? KnownLHS : KnownRHS; KnownOut = XBits.blsmsk(); } diff --git a/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp b/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp index b75cd1beadc58..4ef009c87a1e6 100644 --- a/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp +++ b/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp @@ -829,7 +829,7 @@ bool PolynomialMultiplyRecognize::matchRightShift(SelectInst *SelI, return false; Value *X = nullptr; - if (!match(C, m_c_And(m_Value(X), m_One()))) + if (!match(C, m_And(m_Value(X), m_One()))) return false; // Matched: select (X & 1) == +++ ? ... : ... // select (X & 1) != +++ ? ... : ... diff --git a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp index 75910d7b698aa..65c1a166f992a 100644 --- a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp +++ b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp @@ -425,14 +425,12 @@ void StraightLineStrengthReduce::allocateCandidatesAndFindBasisForAdd( // Returns true if A matches B + C where C is constant. static bool matchesAdd(Value *A, Value *&B, ConstantInt *&C) { - return (match(A, m_Add(m_Value(B), m_ConstantInt(C))) || - match(A, m_Add(m_ConstantInt(C), m_Value(B)))); + return match(A, m_c_Add(m_Value(B), m_ConstantInt(C))); } // Returns true if A matches B | C where C is constant. static bool matchesOr(Value *A, Value *&B, ConstantInt *&C) { - return (match(A, m_Or(m_Value(B), m_ConstantInt(C))) || - match(A, m_Or(m_ConstantInt(C), m_Value(B)))); + return match(A, m_c_Or(m_Value(B), m_ConstantInt(C))); } void StraightLineStrengthReduce::allocateCandidatesAndFindBasisForMul(