Re: [PATCH 1/2] Improve do_store_flag for single bit comparison against 0

2023-05-22 Thread Richard Biener via Gcc-patches
On Mon, May 22, 2023 at 5:21 PM Andrew Pinski wrote: > > On Mon, May 22, 2023 at 4:56 AM Richard Biener via Gcc-patches > wrote: > > > > On Fri, May 19, 2023 at 4:15 AM Andrew Pinski via Gcc-patches > > wrote: > > > > > > While working something else, I noticed we could improve > > > the followi

Re: [PATCH 1/2] Improve do_store_flag for single bit comparison against 0

2023-05-22 Thread Andrew Pinski via Gcc-patches
On Mon, May 22, 2023 at 4:56 AM Richard Biener via Gcc-patches wrote: > > On Fri, May 19, 2023 at 4:15 AM Andrew Pinski via Gcc-patches > wrote: > > > > While working something else, I noticed we could improve > > the following function code generation: > > ``` > > unsigned f(unsigned t) > > { >

Re: [PATCH 1/2] Improve do_store_flag for single bit comparison against 0

2023-05-22 Thread Richard Biener via Gcc-patches
On Fri, May 19, 2023 at 4:15 AM Andrew Pinski via Gcc-patches wrote: > > While working something else, I noticed we could improve > the following function code generation: > ``` > unsigned f(unsigned t) > { > if (t & ~(1<<30)) __builtin_unreachable(); > return t != 0; > } > ``` > Right know we

Re: [PATCH 1/2] Improve do_store_flag for single bit comparison against 0

2023-05-19 Thread Andrew Pinski via Gcc-patches
On Fri, May 19, 2023 at 9:40 AM Jeff Law via Gcc-patches wrote: > > > > On 5/18/23 20:14, Andrew Pinski via Gcc-patches wrote: > > While working something else, I noticed we could improve > > the following function code generation: > > ``` > > unsigned f(unsigned t) > > { > >if (t & ~(1<<30))

Re: [PATCH 1/2] Improve do_store_flag for single bit comparison against 0

2023-05-19 Thread Jeff Law via Gcc-patches
On 5/18/23 20:14, Andrew Pinski via Gcc-patches wrote: While working something else, I noticed we could improve the following function code generation: ``` unsigned f(unsigned t) { if (t & ~(1<<30)) __builtin_unreachable(); return t != 0; } ``` Right know we just emit a comparison agains

[PATCH 1/2] Improve do_store_flag for single bit comparison against 0

2023-05-18 Thread Andrew Pinski via Gcc-patches
While working something else, I noticed we could improve the following function code generation: ``` unsigned f(unsigned t) { if (t & ~(1<<30)) __builtin_unreachable(); return t != 0; } ``` Right know we just emit a comparison against 0 instead of just a shift right by 30. There is code in do_s