Skip to content

Commit 9902285

Browse files
committed
[NFC] Remove non-canonical matching
1 parent c791d86 commit 9902285

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ getKnownBitsFromAndXorOr(const Operator *I, const APInt &DemandedElts,
924924
// Demanded) == (xor(x, x-1) & Demanded). Extend the xor pattern
925925
// to use arbitrary C if xor(x, x-C) as the same as xor(x, x-1).
926926
if (HasKnownOne &&
927-
match(I, m_c_Xor(m_Value(X), m_c_Add(m_Deferred(X), m_AllOnes())))) {
927+
match(I, m_c_Xor(m_Value(X), m_Add(m_Deferred(X), m_AllOnes())))) {
928928
const KnownBits &XBits = I->getOperand(0) == X ? KnownLHS : KnownRHS;
929929
KnownOut = XBits.blsmsk();
930930
}

llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ bool PolynomialMultiplyRecognize::matchRightShift(SelectInst *SelI,
829829
return false;
830830

831831
Value *X = nullptr;
832-
if (!match(C, m_c_And(m_Value(X), m_One())))
832+
if (!match(C, m_And(m_Value(X), m_One())))
833833
return false;
834834
// Matched: select (X & 1) == +++ ? ... : ...
835835
// select (X & 1) != +++ ? ... : ...

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30557,7 +30557,7 @@ static std::pair<Value *, BitTestKind> FindSingleBitChange(Value *V) {
3055730557
bool Not = false;
3055830558
// Check if we have a NOT
3055930559
Value *PeekI;
30560-
if (match(I, m_c_Xor(m_Value(PeekI), m_AllOnes())) ||
30560+
if (match(I, m_Not(m_Value(PeekI))) ||
3056130561
match(I, m_Sub(m_AllOnes(), m_Value(PeekI)))) {
3056230562
Not = true;
3056330563
I = dyn_cast<Instruction>(PeekI);

llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,14 +425,12 @@ void StraightLineStrengthReduce::allocateCandidatesAndFindBasisForAdd(
425425

426426
// Returns true if A matches B + C where C is constant.
427427
static bool matchesAdd(Value *A, Value *&B, ConstantInt *&C) {
428-
return (match(A, m_Add(m_Value(B), m_ConstantInt(C))) ||
429-
match(A, m_Add(m_ConstantInt(C), m_Value(B))));
428+
return match(A, m_Add(m_Value(B), m_ConstantInt(C)));
430429
}
431430

432431
// Returns true if A matches B | C where C is constant.
433432
static bool matchesOr(Value *A, Value *&B, ConstantInt *&C) {
434-
return (match(A, m_Or(m_Value(B), m_ConstantInt(C))) ||
435-
match(A, m_Or(m_ConstantInt(C), m_Value(B))));
433+
return match(A, m_Or(m_Value(B), m_ConstantInt(C)));
436434
}
437435

438436
void StraightLineStrengthReduce::allocateCandidatesAndFindBasisForMul(

0 commit comments

Comments
 (0)