Re: [PATCH 3/4] Add some optimizations to gimple_expand_builtin_cabs

2024-07-02 Thread Richard Biener
On Tue, Jul 2, 2024 at 10:11 AM Richard Biener wrote: > > On Mon, Jul 1, 2024 at 11:48 PM Andrew Pinski > wrote: > > > > While looking into the original folding code for cabs > > (moved to match in r6-4111-gabcc43f5323869), I noticed that > > `cabs(x+0i)` was optimized even without the need of s

Re: [PATCH 3/4] Add some optimizations to gimple_expand_builtin_cabs

2024-07-02 Thread Richard Biener
On Mon, Jul 1, 2024 at 11:48 PM Andrew Pinski wrote: > > While looking into the original folding code for cabs > (moved to match in r6-4111-gabcc43f5323869), I noticed that > `cabs(x+0i)` was optimized even without the need of sqrt. > I also noticed that now the code generation in this case > will

[PATCH 3/4] Add some optimizations to gimple_expand_builtin_cabs

2024-07-01 Thread Andrew Pinski
While looking into the original folding code for cabs (moved to match in r6-4111-gabcc43f5323869), I noticed that `cabs(x+0i)` was optimized even without the need of sqrt. I also noticed that now the code generation in this case will be worse if the target had a sqrt. So let's implement this small