[PATCH] MATCH: Fix patterns of type (a != b) and (a == b) [PR117760]

2025-04-14 Thread Eikansh Gupta
== 0): New pattern. ((a == b) & (a | b) == 0): New pattern. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/pr117760-1.c: New test. * gcc.dg/tree-ssa/pr117760-2.c: New test. * gcc.dg/tree-ssa/pr117760.c: New test. Signed-off-by: Eikansh Gupta ---

[PATCH] aarch64: Improve immediate generation by using SUB instruction [PR114528]

2025-02-28 Thread Eikansh Gupta
/testsuite/ChangeLog: * gcc.target/aarch64/pr114528.c: New test. Signed-off-by: Eikansh Gupta --- gcc/config/aarch64/aarch64.cc | 44 - gcc/testsuite/gcc.target/aarch64/pr114528.c | 53 + 2 files changed, 95 insertions(+), 2 deletions

RE: [PATCH v3] MATCH: Simplify `(trunc)copysign ((extend)x, CST)` to `copysign (x, -1.0/1.0)` [PR112472]

2024-12-02 Thread Eikansh Gupta
> On Thu, Nov 14, 2024 at 11:59 AM Eikansh Gupta > wrote: > > > > This patch simplify `(trunc)copysign ((extend)x, CST)` to `copysign > > (x, -1.0/1.0)` depending on the sign of CST. Previously, it was simplified > > to > `copysign (x, CST)`. > > It

Re: [PATCH v2] MATCH: Simplify `min(a, b) op max(a, b)` to `a op b` [PR109401]

2024-11-15 Thread Eikansh Gupta
: Eikansh Gupta ; Eikansh Gupta (QUIC) ; 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

[PATCH v3] MATCH: Simplify `(trunc)copysign ((extend)x, CST)` to `copysign (x, -1.0/1.0)` [PR112472]

2024-11-14 Thread Eikansh Gupta
off-by: Eikansh Gupta --- gcc/match.pd | 25 +++- gcc/testsuite/gcc.dg/tree-ssa/pr112472.c | 22 + 2 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr112472.c diff --git a/gcc/matc

Re: [PATCH v2] MATCH: Simplify `min(a, b) op max(a, b)` to `a op b` [PR109401]

2024-11-11 Thread Eikansh Gupta
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. Regards, Eikansh From: Jeff Law Sent: Tuesday, November 12, 2024 12:55 AM To: Eika

[PATCH v2] MATCH: Simplify `min(a, b) op max(a, b)` to `a op b` [PR109401]

2024-11-11 Thread Eikansh Gupta
: * match.pd (min(a,b) op max(a,b) -> a op b): New pattern. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/pr109401.c: New test. * gcc.dg/tree-ssa/pr109401-1.c: New test. Signed-off-by: Eikansh Gupta --- gcc/match.pd | 7 +++ gcc/testsuite/gcc.dg/t

[PATCH v4] MATCH: Simplify `a rrotate (32-b) -> a lrotate b` [PR109906]

2024-11-11 Thread Eikansh Gupta
ux-gnu with no regressions. PR tree-optimization/109906 gcc/ChangeLog: * match.pd (a rrotate (32-b) -> a lrotate b): New pattern (a lrotate (32-b) -> a rrotate b): New pattern gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/pr109906.c: New test. Signed-off

[PATCH v3] MATCH: Simplify `a rrotate (32-b) -> a lrotate b` [PR109906]

2024-10-16 Thread Eikansh Gupta
ux-gnu with no regressions. PR tree-optimization/109906 gcc/ChangeLog: * match.pd (a rrotate (32-b) -> a lrotate b): New pattern (a lrotate (32-b) -> a rrotate b): New pattern gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/pr109906.c: New test. Signed-off

[PATCH v2] MATCH: Simplify `(trunc)copysign ((extend)x, CST)` to `copysign (x, -1.0/1.0)` [PR112472]

2024-10-16 Thread Eikansh Gupta
off-by: Eikansh Gupta --- gcc/match.pd | 20 +--- gcc/testsuite/gcc.dg/tree-ssa/pr112472.c | 22 ++ 2 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr112472.c diff --git a/gcc/match.pd

[PATCH] MATCH: Simplify `min(a, b) op max(a, b)` to `a op b` [PR109401]

2024-09-25 Thread Eikansh Gupta
This patch simplify `min(a,b) op max(a,b)` to `a op b`. This optimization will work for all the binary commutative operations. So, the `op` here can be one of {plus, mult, bit_and, bit_xor, bit_ior, eq, ne, min, max}. PR tree-optimization/109878 PR 109401 gcc/ChangeLog: *

[PATCH] MATCH: Simplify `(trunc)copysign ((extend)x, CST)` to `copysign (x, -1.0/1.0)` [PR112472]

2024-09-24 Thread Eikansh Gupta
This patch simplify `(trunc)copysign ((extend)x, CST)` to `copysign (x, -1.0/1.0)` depending on the sign of CST. Previously, it was simplified to `copysign (x, CST)`. It can be optimized as the sign of the CST matters, not the value. The patch also simplify `(trunc)abs (extend x)` to `abs (x)`.

[PATCH v2] MATCH: Simplify `a rrotate (32-b) -> a lrotate b` [PR109906]

2024-09-17 Thread Eikansh Gupta
The pattern `a rrotate (32-b)` should be optimized to `a lrotate b`. The same is also true for `a lrotate (32-b)`. It can be optimized to `a rrotate b`. This patch adds following patterns: a rrotate (32-b) -> a lrotate b a lrotate (32-b) -> a rrotate b PR tree-optimization/109906 gcc/Cha

[PATCH] MATCH: Simplify `a rrotate (32-b) -> a lrotate b` [PR109906]

2024-09-17 Thread Eikansh Gupta
The pattern `a rrotate (32-b)` should be optimized to `a lrotate b`. The same is also true for `a lrotate (32-b)`. It can be optimized to `a rrotate b`. This patch adds following patterns: a rrotate (32-b) -> a lrotate b a lrotate (32-b) -> a rrotate b PR tree-optimization/109906 gcc/Cha

[PATCH v2] MATCH: Add simplification for MAX and MIN to match.pd [PR109878]

2024-07-19 Thread Eikansh Gupta
match.pd min/max (a & CST0, a & CST1): New pattern. min/max (a, a & CST): New pattern. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/pr109878-1.c: New test. * gcc.dg/tree-ssa/pr109878-2.c: New test. * gcc.dg/tree-ssa/pr109878-3.c: New test. * g

[PATCH] MATCH: Add simplification for MAX and MIN to match.pd [PR109878]

2024-07-17 Thread Eikansh Gupta
pd min/max (a & CST0, a & CST1): New pattern. min/max (a, a & 1): New pattern. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/pr109878.c: New test. * gcc.dg/tree-ssa/pr109878-1.c: New test. * gcc.dg/tree-ssa/pr109878-2.c: New test. * gcc.dg/tree-

[PATCH v2] MATCH: Simplify (a ? x : y) eq/ne (b ? x : y) [PR111150]

2024-07-16 Thread Eikansh Gupta
igned-off-by: Eikansh Gupta --- gcc/match.pd | 15 + gcc/testsuite/g++.dg/tree-ssa/pr50.C | 33 ++ gcc/testsuite/gcc.dg/tree-ssa/pr50-1.c | 72 ++ gcc/testsuite/gcc.dg/tree-ssa/pr50.c | 22 +++ 4 files changed, 14

[PATCH] MATCH: Simplify (vec CMP vec) eq/ne (vec CMP vec) [PR111150]

2024-06-21 Thread Eikansh Gupta
w test. Signed-off-by: Eikansh Gupta --- gcc/match.pd | 18 ++ gcc/testsuite/gcc.dg/tree-ssa/pr50.c | 19 +++ 2 files changed, 37 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr50.c diff --git a/gcc/match.pd