Hi Jeff, The patch has support for both. In the test cases, approx half the test cases have min(a, b) op max(a, b) and the other half have max(a, b) op min(a, b).
Regards, Eikansh ________________________________ From: Andrew Pinski <pins...@gmail.com> Sent: Friday, November 15, 2024 7:03 AM To: Jeff Law <jeffreya...@gmail.com> Cc: Eikansh Gupta <eikag...@qti.qualcomm.com>; Eikansh Gupta (QUIC) <quic_eikag...@quicinc.com>; gcc-patches@gcc.gnu.org <gcc-patches@gcc.gnu.org> Subject: Re: [PATCH v2] MATCH: Simplify `min(a, b) op max(a, b)` to `a op b` [PR109401] WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros. On Thu, Nov 14, 2024 at 5:30 PM Jeff Law <jeffreya...@gmail.com> wrote: > > > > On 11/11/24 9:32 PM, Eikansh Gupta wrote: > > Hi, > > > > > It seems to me this ought to work when the min/max reversed > > as well, or > > > am I missing something? > > > > Yes, it should work when min/max are reversed. > So are you going to add support for both? Seems to me like we'd want to > support both orders. Both orders are already supported: + (op:c (min:c @0 @1) (max @0 @1)) Notice the `:c` on op. It means both `(plus (min @0 @1) (max @0 @1) )` and `(plus (max @0 @1) (min @0 @1) )` will match. Unless I am misunderstanding something here too. Thanks, Andrew Pinski > > jeff >