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

2023-06-04 Thread Jeff Law via Gcc-patches
On 5/20/23 09:04, 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

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

2023-05-20 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