Re: [PATCH] isel: Fold more in gimple_expand_vec_cond_expr [PR115659]

2024-07-02 Thread Kewen.Lin
on 2024/7/1 22:28, Richard Biener wrote: > On Mon, Jul 1, 2024 at 8:16 AM Kewen.Lin wrote: >> >> Hi, >> >> As PR115659 shows, assuming c = x CMP y, there are some >> folding chances for patterns r = c ? -1/z : z/0. >> >> For r = c ? -1 : z, it can be folded into: >> - r = c | z (with ior_optab s

Re: [PATCH] isel: Fold more in gimple_expand_vec_cond_expr [PR115659]

2024-07-01 Thread Richard Biener
On Mon, Jul 1, 2024 at 8:16 AM Kewen.Lin wrote: > > Hi, > > As PR115659 shows, assuming c = x CMP y, there are some > folding chances for patterns r = c ? -1/z : z/0. > > For r = c ? -1 : z, it can be folded into: > - r = c | z (with ior_optab supported) > - or r = c ? c : z > > while for r =

[PATCH] isel: Fold more in gimple_expand_vec_cond_expr [PR115659]

2024-07-01 Thread Kewen.Lin
Hi, As PR115659 shows, assuming c = x CMP y, there are some folding chances for patterns r = c ? -1/z : z/0. For r = c ? -1 : z, it can be folded into: - r = c | z (with ior_optab supported) - or r = c ? c : z while for r = c ? z : 0, it can be foled into: - r = c & z (with and_optab supp