Skip to content

Commit b100cef

Browse files
committed
[NFC] Use m_Not instead of m_c_Xor with m_AllOnes()
1 parent 1b8ab2f commit b100cef

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

llvm/include/llvm/IR/PatternMatch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2343,7 +2343,7 @@ struct UAddWithOverflow_match {
23432343
return L.match(AddLHS) && R.match(AddRHS) && S.match(ICmpRHS);
23442344

23452345
Value *Op1;
2346-
auto XorExpr = m_OneUse(m_Xor(m_Value(Op1), m_AllOnes()));
2346+
auto XorExpr = m_OneUse(m_Not(m_Value(Op1)));
23472347
// (a ^ -1) <u b
23482348
if (Pred == ICmpInst::ICMP_ULT) {
23492349
if (XorExpr.match(ICmpLHS))

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/InstCombine/InstCombineShifts.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ dropRedundantMaskingOfLeftShiftInput(BinaryOperator *OuterShift,
216216
// ((1 << MaskShAmt) - 1)
217217
auto MaskA = m_Add(m_Shl(m_One(), m_Value(MaskShAmt)), m_AllOnes());
218218
// (~(-1 << maskNbits))
219-
auto MaskB = m_Xor(m_Shl(m_AllOnes(), m_Value(MaskShAmt)), m_AllOnes());
219+
auto MaskB = m_Not(m_Shl(m_AllOnes(), m_Value(MaskShAmt)));
220220
// (-1 l>> MaskShAmt)
221221
auto MaskC = m_LShr(m_AllOnes(), m_Value(MaskShAmt));
222222
// ((-1 << MaskShAmt) l>> MaskShAmt)

0 commit comments

Comments
 (0)