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

2024-06-21 Thread Eikansh Gupta
We can optimize (vec_cond eq/ne vec_cond) when vec_cond is a result of (vec CMP vec). The optimization is because of the observation that in vec_cond, (-1 != 0) is true. So, we can generate vec_cond of xor of vec resulting in a single VEC_COND_EXPR instead of 3. The patch adds match pattern for ve

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

2024-06-21 Thread Richard Biener
On Fri, Jun 21, 2024 at 9:12 AM Eikansh Gupta wrote: > > We can optimize (vec_cond eq/ne vec_cond) when vec_cond is a > result of (vec CMP vec). The optimization is because of the > observation that in vec_cond, (-1 != 0) is true. So, we can > generate vec_cond of xor of vec resulting in a single

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

2024-06-22 Thread Andrew Pinski
On Fri, Jun 21, 2024 at 1:04 AM Richard Biener wrote: > > On Fri, Jun 21, 2024 at 9:12 AM Eikansh Gupta > wrote: > > > > We can optimize (vec_cond eq/ne vec_cond) when vec_cond is a > > result of (vec CMP vec). The optimization is because of the > > observation that in vec_cond, (-1 != 0) is tru