Re: [PATCH] match: `a CMP nonnegative ? a : ABS` simplified to just `ABS` [PR112392]

2024-05-08 Thread Richard Biener
On Wed, May 8, 2024 at 5:25 AM Andrew Pinski wrote: > > We can optimize `a == nonnegative ? a : ABS`, `a > nonnegative ? a : > ABS` > and `a >= nonnegative ? a : ABS` into `ABS`. This allows removal of > some extra comparison and extra conditional moves in some cases. > I don't remember where I

[PATCH] match: `a CMP nonnegative ? a : ABS` simplified to just `ABS` [PR112392]

2024-05-07 Thread Andrew Pinski
We can optimize `a == nonnegative ? a : ABS`, `a > nonnegative ? a : ABS` and `a >= nonnegative ? a : ABS` into `ABS`. This allows removal of some extra comparison and extra conditional moves in some cases. I don't remember where I had found though but it is simple to add so let's add it.