Re: [PATCH] Add support for floating point endpoints to frange.

2022-08-31 Thread Jeff Law via Gcc-patches
On 8/29/2022 8:30 AM, Aldy Hernandez via Gcc-patches wrote: On Mon, Aug 29, 2022 at 4:27 PM Jakub Jelinek wrote: On Mon, Aug 29, 2022 at 04:20:16PM +0200, Aldy Hernandez wrote: Sure, I can add the HONOR_NANS, but can we even "see" a NAN in the IL for -ffinite-math-only? Sure, you can, e.g.

Re: [PATCH] Add support for floating point endpoints to frange.

2022-08-31 Thread Jeff Law via Gcc-patches
On 8/29/2022 8:42 AM, Toon Moene wrote: On 8/29/22 16:36, Aldy Hernandez wrote: On Mon, Aug 29, 2022 at 4:30 PM Toon Moene wrote: On 8/29/22 16:15, Aldy Hernandez wrote: But even with -ffinite-math-only, is there any benefit to propagating a known NAN?  For example: The original inten

Re: [PATCH] Add support for floating point endpoints to frange.

2022-08-31 Thread Jeff Law via Gcc-patches
On 8/29/2022 8:15 AM, Aldy Hernandez via Gcc-patches wrote: On Mon, Aug 29, 2022 at 4:08 PM Toon Moene wrote: On 8/29/22 15:54, Jakub Jelinek via Gcc-patches wrote: On Mon, Aug 29, 2022 at 03:45:33PM +0200, Aldy Hernandez wrote: For convenience, singleton_p() returns false for a NAN. IMO

Re: [PATCH] Add support for floating point endpoints to frange.

2022-08-31 Thread Jeff Law via Gcc-patches
On 8/29/2022 7:54 AM, Jakub Jelinek via Gcc-patches wrote: On Mon, Aug 29, 2022 at 03:45:33PM +0200, Aldy Hernandez wrote: For convenience, singleton_p() returns false for a NAN. IMO, it makes the implementation cleaner, but I'm not wed to the idea if someone objects. If singleton_p() is us

Re: [PATCH] Add support for floating point endpoints to frange.

2022-08-30 Thread Joseph Myers
On Mon, 29 Aug 2022, Jakub Jelinek via Gcc-patches wrote: > On Mon, Aug 29, 2022 at 03:45:33PM +0200, Aldy Hernandez wrote: > > For convenience, singleton_p() returns false for a NAN. IMO, it makes > > the implementation cleaner, but I'm not wed to the idea if someone > > objects. > > If singlet

Re: [PATCH] Add support for floating point endpoints to frange.

2022-08-30 Thread Aldy Hernandez via Gcc-patches
OK, I'm good to go. As the patch was getting rather large, I have split it into two parts. The first is the core endpoints support to frange along with removal of the +-INF markers (since they are no longer needed). The second part is the FP relational operators. Splitting it up should help in r

Re: [PATCH] Add support for floating point endpoints to frange.

2022-08-29 Thread Toon Moene
On 8/29/22 16:36, Aldy Hernandez wrote: On Mon, Aug 29, 2022 at 4:30 PM Toon Moene wrote: On 8/29/22 16:15, Aldy Hernandez wrote: But even with -ffinite-math-only, is there any benefit to propagating a known NAN? For example: The original intent (in 2002) for the option -ffinite-math-onl

Re: [PATCH] Add support for floating point endpoints to frange.

2022-08-29 Thread Aldy Hernandez via Gcc-patches
On Mon, Aug 29, 2022 at 4:30 PM Toon Moene wrote: > > On 8/29/22 16:15, Aldy Hernandez wrote: > > > But even with -ffinite-math-only, is there any benefit to propagating > > a known NAN? For example: > > The original intent (in 2002) for the option -ffinite-math-only was for > the optimizers to i

Re: [PATCH] Add support for floating point endpoints to frange.

2022-08-29 Thread Aldy Hernandez via Gcc-patches
On Mon, Aug 29, 2022 at 4:27 PM Jakub Jelinek wrote: > > On Mon, Aug 29, 2022 at 04:20:16PM +0200, Aldy Hernandez wrote: > > Sure, I can add the HONOR_NANS, but can we even "see" a NAN in the IL > > for -ffinite-math-only? > > Sure, you can, e.g. __builtin_nan{,s}{,f,l} etc. would do it. > It woul

Re: [PATCH] Add support for floating point endpoints to frange.

2022-08-29 Thread Toon Moene
On 8/29/22 16:15, Aldy Hernandez wrote: But even with -ffinite-math-only, is there any benefit to propagating a known NAN? For example: The original intent (in 2002) for the option -ffinite-math-only was for the optimizers to ignore all the various exceptions to common optimizations because

Re: [PATCH] Add support for floating point endpoints to frange.

2022-08-29 Thread Jakub Jelinek via Gcc-patches
On Mon, Aug 29, 2022 at 04:20:16PM +0200, Aldy Hernandez wrote: > Sure, I can add the HONOR_NANS, but can we even "see" a NAN in the IL > for -ffinite-math-only? Sure, you can, e.g. __builtin_nan{,s}{,f,l} etc. would do it. It would be UB to use it at runtime in -ffinite-math-only code though. Ano

Re: [PATCH] Add support for floating point endpoints to frange.

2022-08-29 Thread Aldy Hernandez via Gcc-patches
On Mon, Aug 29, 2022 at 4:17 PM Jakub Jelinek wrote: > > On Mon, Aug 29, 2022 at 04:08:58PM +0200, Aldy Hernandez wrote: > > On Mon, Aug 29, 2022 at 3:55 PM Jakub Jelinek wrote: > > > > > > On Mon, Aug 29, 2022 at 03:45:33PM +0200, Aldy Hernandez wrote: > > > > For convenience, singleton_p() retu

Re: [PATCH] Add support for floating point endpoints to frange.

2022-08-29 Thread Jakub Jelinek via Gcc-patches
On Mon, Aug 29, 2022 at 04:08:58PM +0200, Aldy Hernandez wrote: > On Mon, Aug 29, 2022 at 3:55 PM Jakub Jelinek wrote: > > > > On Mon, Aug 29, 2022 at 03:45:33PM +0200, Aldy Hernandez wrote: > > > For convenience, singleton_p() returns false for a NAN. IMO, it makes > > > the implementation clean

Re: [PATCH] Add support for floating point endpoints to frange.

2022-08-29 Thread Aldy Hernandez via Gcc-patches
On Mon, Aug 29, 2022 at 4:08 PM Toon Moene wrote: > > On 8/29/22 15:54, Jakub Jelinek via Gcc-patches wrote: > > > On Mon, Aug 29, 2022 at 03:45:33PM +0200, Aldy Hernandez wrote: > > >> For convenience, singleton_p() returns false for a NAN. IMO, it makes > >> the implementation cleaner, but I'm

Re: [PATCH] Add support for floating point endpoints to frange.

2022-08-29 Thread Aldy Hernandez via Gcc-patches
On Mon, Aug 29, 2022 at 3:55 PM Jakub Jelinek wrote: > > On Mon, Aug 29, 2022 at 03:45:33PM +0200, Aldy Hernandez wrote: > > For convenience, singleton_p() returns false for a NAN. IMO, it makes > > the implementation cleaner, but I'm not wed to the idea if someone > > objects. > > If singleton_p

Re: [PATCH] Add support for floating point endpoints to frange.

2022-08-29 Thread Toon Moene
On 8/29/22 15:54, Jakub Jelinek via Gcc-patches wrote: On Mon, Aug 29, 2022 at 03:45:33PM +0200, Aldy Hernandez wrote: For convenience, singleton_p() returns false for a NAN. IMO, it makes the implementation cleaner, but I'm not wed to the idea if someone objects. If singleton_p() is used

Re: [PATCH] Add support for floating point endpoints to frange.

2022-08-29 Thread Jakub Jelinek via Gcc-patches
On Mon, Aug 29, 2022 at 03:45:33PM +0200, Aldy Hernandez wrote: > For convenience, singleton_p() returns false for a NAN. IMO, it makes > the implementation cleaner, but I'm not wed to the idea if someone > objects. If singleton_p() is used to decide whether one can just replace a variable with s

Re: [PATCH] Add support for floating point endpoints to frange.

2022-08-29 Thread Aldy Hernandez via Gcc-patches
Jakub, et al... here is the latest version of the frange endpoints patch addressing the signed zero problem (well treating +-0.0 ambiguously), as well as implementing all the relational operators. [Andrew M: I mostly copied our relop code from irange, while keeping track NANs, etc. It should be p

Re: [PATCH] Add support for floating point endpoints to frange.

2022-08-26 Thread Andrew Pinski via Gcc-patches
On Fri, Aug 26, 2022 at 12:16 PM Aldy Hernandez wrote: > > On Fri, Aug 26, 2022 at 7:40 PM Andrew Pinski wrote: > > > > On Fri, Aug 26, 2022 at 8:55 AM Aldy Hernandez wrote: > > > > > > [pinskia: I'm CCing you as the author of the match.pd pattern.] > > > > > > So, as I wrap up the work here (la

Re: [PATCH] Add support for floating point endpoints to frange.

2022-08-26 Thread Aldy Hernandez via Gcc-patches
On Fri, Aug 26, 2022 at 7:40 PM Andrew Pinski wrote: > > On Fri, Aug 26, 2022 at 8:55 AM Aldy Hernandez wrote: > > > > [pinskia: I'm CCing you as the author of the match.pd pattern.] > > > > So, as I wrap up the work here (latest patch attached), I see there's > > another phiopt regression (not s

Re: [PATCH] Add support for floating point endpoints to frange.

2022-08-26 Thread Aldy Hernandez via Gcc-patches
On Fri, Aug 26, 2022, 19:40 Andrew Pinski wrote: > On Fri, Aug 26, 2022 at 8:55 AM Aldy Hernandez wrote: > > > > [pinskia: I'm CCing you as the author of the match.pd pattern.] > > > > So, as I wrap up the work here (latest patch attached), I see there's > > another phiopt regression (not spaces

Re: [PATCH] Add support for floating point endpoints to frange.

2022-08-26 Thread Andrew Pinski via Gcc-patches
On Fri, Aug 26, 2022 at 8:55 AM Aldy Hernandez wrote: > > [pinskia: I'm CCing you as the author of the match.pd pattern.] > > So, as I wrap up the work here (latest patch attached), I see there's > another phiopt regression (not spaceship related). I was hoping > someone could either give me a ha

Re: [PATCH] Add support for floating point endpoints to frange.

2022-08-26 Thread Aldy Hernandez via Gcc-patches
[pinskia: I'm CCing you as the author of the match.pd pattern.] So, as I wrap up the work here (latest patch attached), I see there's another phiopt regression (not spaceship related). I was hoping someone could either give me a hand, or offer some guidance. The failure is in gcc.dg/tree-ssa/phi