@@ -451,15 +451,15 @@ struct BinaryOp_match {
451
451
const MachineInstr *TmpMI;
452
452
if (mi_match (Op, MRI, m_MInstr (TmpMI))) {
453
453
if (TmpMI->getOpcode () == Opcode && TmpMI->getNumOperands () == 3 ) {
454
- if (!( L.match (MRI, TmpMI->getOperand (1 ).getReg ()) &&
455
- R.match (MRI, TmpMI->getOperand (2 ).getReg ())) &&
454
+ if ((! L.match (MRI, TmpMI->getOperand (1 ).getReg ()) ||
455
+ ! R.match (MRI, TmpMI->getOperand (2 ).getReg ())) &&
456
456
// NOTE: When trying the alternative operand ordering
457
457
// with a commutative operation, it is imperative to always run
458
458
// the LHS sub-pattern (i.e. `L`) before the RHS sub-pattern
459
- // (i.e. `R`). Otherwsie , m_DeferredReg/Type will not work as
459
+ // (i.e. `R`). Otherwise , m_DeferredReg/Type will not work as
460
460
// expected.
461
- !( Commutable && ( L.match (MRI, TmpMI->getOperand (2 ).getReg ()) &&
462
- R.match (MRI, TmpMI->getOperand (1 ).getReg () ))))
461
+ (! Commutable || ! L.match (MRI, TmpMI->getOperand (2 ).getReg ()) ||
462
+ ! R.match (MRI, TmpMI->getOperand (1 ).getReg ())))
463
463
return false ;
464
464
return (TmpMI->getFlags () & Flags) == Flags;
465
465
}
@@ -488,7 +488,7 @@ struct BinaryOpc_match {
488
488
// NOTE: When trying the alternative operand ordering
489
489
// with a commutative operation, it is imperative to always run
490
490
// the LHS sub-pattern (i.e. `L`) before the RHS sub-pattern
491
- // (i.e. `R`). Otherwsie , m_DeferredReg/Type will not work as
491
+ // (i.e. `R`). Otherwise , m_DeferredReg/Type will not work as
492
492
// expected.
493
493
(Commutable && (L.match (MRI, TmpMI->getOperand (2 ).getReg ()) &&
494
494
R.match (MRI, TmpMI->getOperand (1 ).getReg ())));
@@ -754,7 +754,7 @@ struct CompareOp_match {
754
754
// NOTE: When trying the alternative operand ordering
755
755
// with a commutative operation, it is imperative to always run
756
756
// the LHS sub-pattern (i.e. `L`) before the RHS sub-pattern
757
- // (i.e. `R`). Otherwsie , m_DeferredReg/Type will not work as expected.
757
+ // (i.e. `R`). Otherwise , m_DeferredReg/Type will not work as expected.
758
758
if (Commutable && L.match (MRI, RHS) && R.match (MRI, LHS) &&
759
759
P.match (MRI, CmpInst::getSwappedPredicate (TmpPred)))
760
760
return true ;
0 commit comments