@@ -770,8 +770,7 @@ bool PolynomialMultiplyRecognize::matchLeftShift(SelectInst *SelI,
770
770
// select +++ ? T : 0
771
771
772
772
Value *U = *SelI->user_begin ();
773
- if (!match (U, m_Xor (m_Specific (SelI), m_Value (R))) &&
774
- !match (U, m_Xor (m_Value (R), m_Specific (SelI))))
773
+ if (!match (U, m_c_Xor (m_Specific (SelI), m_Value (R))))
775
774
return false ;
776
775
// Matched: xor (select +++ ? 0 : T), R
777
776
// xor (select +++ ? T : 0), R
@@ -814,15 +813,13 @@ bool PolynomialMultiplyRecognize::matchRightShift(SelectInst *SelI,
814
813
CmpInst::Predicate P;
815
814
bool TrueIfZero;
816
815
817
- if (match (CondV, m_ICmp (P, m_Value (C), m_Zero ())) ||
818
- match (CondV, m_ICmp (P, m_Zero (), m_Value (C)))) {
816
+ if (match (CondV, m_c_ICmp (P, m_Value (C), m_Zero ()))) {
819
817
if (P != CmpInst::ICMP_EQ && P != CmpInst::ICMP_NE)
820
818
return false ;
821
819
// Matched: select C == 0 ? ... : ...
822
820
// select C != 0 ? ... : ...
823
821
TrueIfZero = (P == CmpInst::ICMP_EQ);
824
- } else if (match (CondV, m_ICmp (P, m_Value (C), m_One ())) ||
825
- match (CondV, m_ICmp (P, m_One (), m_Value (C)))) {
822
+ } else if (match (CondV, m_c_ICmp (P, m_Value (C), m_One ()))) {
826
823
if (P != CmpInst::ICMP_EQ && P != CmpInst::ICMP_NE)
827
824
return false ;
828
825
// Matched: select C == 1 ? ... : ...
@@ -832,8 +829,7 @@ bool PolynomialMultiplyRecognize::matchRightShift(SelectInst *SelI,
832
829
return false ;
833
830
834
831
Value *X = nullptr ;
835
- if (!match (C, m_And (m_Value (X), m_One ())) &&
836
- !match (C, m_And (m_One (), m_Value (X))))
832
+ if (!match (C, m_c_And (m_Value (X), m_One ())))
837
833
return false ;
838
834
// Matched: select (X & 1) == +++ ? ... : ...
839
835
// select (X & 1) != +++ ? ... : ...
@@ -845,8 +841,7 @@ bool PolynomialMultiplyRecognize::matchRightShift(SelectInst *SelI,
845
841
if (!match (TrueV, m_LShr (m_Value (R), m_One ())))
846
842
return false ;
847
843
// Matched: select +++ ? (R >> 1) : ...
848
- if (!match (FalseV, m_Xor (m_Specific (TrueV), m_Value (Q))) &&
849
- !match (FalseV, m_Xor (m_Value (Q), m_Specific (TrueV))))
844
+ if (!match (FalseV, m_c_Xor (m_Specific (TrueV), m_Value (Q))))
850
845
return false ;
851
846
// Matched: select +++ ? (R >> 1) : (R >> 1) ^ Q
852
847
// with commuting ^.
@@ -856,8 +851,7 @@ bool PolynomialMultiplyRecognize::matchRightShift(SelectInst *SelI,
856
851
if (!match (FalseV, m_LShr (m_Value (R), m_One ())))
857
852
return false ;
858
853
// Matched: select +++ ? ... : (R >> 1)
859
- if (!match (TrueV, m_Xor (m_Specific (FalseV), m_Value (Q))) &&
860
- !match (TrueV, m_Xor (m_Value (Q), m_Specific (FalseV))))
854
+ if (!match (TrueV, m_c_Xor (m_Specific (FalseV), m_Value (Q))))
861
855
return false ;
862
856
// Matched: select +++ ? (R >> 1) ^ Q : (R >> 1)
863
857
// with commuting ^.
0 commit comments