Re: [PATCH] middle-end IFN_ASSUME support [PR106654]

2022-11-08 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 08, 2022 at 10:19:50AM +0100, Pilar Latiesa via Gcc-patches wrote: > On Mon, Oct 17, 2022 at 05:32:32AM +0200, Martin Uecker wrote: > > Hm, that already seems to work with > > > > if (!std::isfinite(x)) > > __builtin_unreachable(); > > > > https://godbolt.org/z/hj3WrEhjb > > Not anym

[PATCH] middle-end IFN_ASSUME support [PR106654]

2022-11-08 Thread Pilar Latiesa via Gcc-patches
On Mon, Oct 17, 2022 at 05:32:32AM +0200, Martin Uecker wrote: > Hm, that already seems to work with > > if (!std::isfinite(x)) > __builtin_unreachable(); > > https://godbolt.org/z/hj3WrEhjb Not anymore. Perhaps after making ranger the VRP default, because I get the mentioned outcome with --para

Re: [PATCH] middle-end IFN_ASSUME support [PR106654]

2022-10-17 Thread Andrew MacLeod via Gcc-patches
The assume function can have many arguments (one is created for each automatic var referenced or set by the condition), so it would be nice to track all of them rather than just hardcoding the first. And, the argument doesn't necessarily have to be a scalar, so perhaps later on we could derive

Re: [PATCH] middle-end IFN_ASSUME support [PR106654]

2022-10-16 Thread Martin Uecker via Gcc-patches
Am Samstag, den 15.10.2022, 10:53 +0200 schrieb Jakub Jelinek: > On Sat, Oct 15, 2022 at 10:07:46AM +0200, Martin Uecker wrote: > > But why? Do we really want to encourage people to > > write such code? > > Of course these ++ cases inside of expressions are just obfuscation. > But the point is to

Re: [PATCH] middle-end IFN_ASSUME support [PR106654]

2022-10-15 Thread Jakub Jelinek via Gcc-patches
On Sat, Oct 15, 2022 at 10:07:46AM +0200, Martin Uecker wrote: > But why? Do we really want to encourage people to > write such code? Of course these ++ cases inside of expressions are just obfuscation. But the point is to support using predicates that can be inlined and simplified into something

Re: [PATCH] middle-end IFN_ASSUME support [PR106654]

2022-10-15 Thread Martin Uecker via Gcc-patches
Am Freitag, den 14.10.2022, 23:20 +0200 schrieb Jakub Jelinek: > On Fri, Oct 14, 2022 at 10:43:16PM +0200, Martin Uecker wrote: > > Am Montag, den 10.10.2022, 10:54 +0200 schrieb Jakub Jelinek: > > > Hi! > > > > > > My earlier patches gimplify the simplest non-side-effects assumptions > > > into i

Re: [PATCH] middle-end IFN_ASSUME support [PR106654]

2022-10-14 Thread Jakub Jelinek via Gcc-patches
On Fri, Oct 14, 2022 at 10:43:16PM +0200, Martin Uecker wrote: > Am Montag, den 10.10.2022, 10:54 +0200 schrieb Jakub Jelinek: > > Hi! > > > > My earlier patches gimplify the simplest non-side-effects assumptions > > into if (cond) ; else __builtin_unreachable (); and throw the rest > > on the flo

Re: [PATCH] middle-end IFN_ASSUME support [PR106654]

2022-10-14 Thread Martin Uecker via Gcc-patches
Am Montag, den 10.10.2022, 10:54 +0200 schrieb Jakub Jelinek: > Hi! > > My earlier patches gimplify the simplest non-side-effects assumptions > into if (cond) ; else __builtin_unreachable (); and throw the rest > on the floor. > The following patch attempts to do something with the rest too. My r

Re: [PATCH] middle-end IFN_ASSUME support [PR106654]

2022-10-13 Thread Andrew MacLeod via Gcc-patches
On 10/13/22 05:53, Jakub Jelinek wrote: On Thu, Oct 13, 2022 at 08:11:53AM +, Richard Biener wrote: On Wed, 12 Oct 2022, Andrew MacLeod wrote: On 10/12/22 10:39, Jakub Jelinek wrote: On Wed, Oct 12, 2022 at 10:31:00AM -0400, Andrew MacLeod wrote: I presume you are looking to get this w

Re: [PATCH] middle-end IFN_ASSUME support [PR106654]

2022-10-13 Thread Jakub Jelinek via Gcc-patches
On Wed, Oct 12, 2022 at 12:12:38PM -0400, Andrew MacLeod wrote: > No, I just meant that once we finally process the complicated function, and > decide the final range we are storing is for x_1 is say [20,30], we could > replace the assume call site with something like > >   int assume03_x (x) { if

Re: [PATCH] middle-end IFN_ASSUME support [PR106654]

2022-10-13 Thread Jakub Jelinek via Gcc-patches
On Thu, Oct 13, 2022 at 08:11:53AM +, Richard Biener wrote: > On Wed, 12 Oct 2022, Andrew MacLeod wrote: > > > > > On 10/12/22 10:39, Jakub Jelinek wrote: > > > On Wed, Oct 12, 2022 at 10:31:00AM -0400, Andrew MacLeod wrote: > > >> I presume you are looking to get this working for this releas

Re: [PATCH] middle-end IFN_ASSUME support [PR106654]

2022-10-13 Thread Richard Biener via Gcc-patches
On Wed, 12 Oct 2022, Andrew MacLeod wrote: > > On 10/12/22 10:39, Jakub Jelinek wrote: > > On Wed, Oct 12, 2022 at 10:31:00AM -0400, Andrew MacLeod wrote: > >> I presume you are looking to get this working for this release, making the > >> priority high? :-) > > Yes. So that we can claim we actu

Re: [PATCH] middle-end IFN_ASSUME support [PR106654]

2022-10-12 Thread Andrew MacLeod via Gcc-patches
On 10/12/22 10:39, Jakub Jelinek wrote: On Wed, Oct 12, 2022 at 10:31:00AM -0400, Andrew MacLeod wrote: I presume you are looking to get this working for this release, making the priority high? :-) Yes. So that we can claim we actually support C++23 Portable Assumptions and OpenMP assume dir

Re: [PATCH] middle-end IFN_ASSUME support [PR106654]

2022-10-12 Thread Jakub Jelinek via Gcc-patches
On Wed, Oct 12, 2022 at 10:31:00AM -0400, Andrew MacLeod wrote: > I presume you are looking to get this working for this release, making the > priority high? :-) Yes. So that we can claim we actually support C++23 Portable Assumptions and OpenMP assume directive's hold clauses for something non-t

Re: [PATCH] middle-end IFN_ASSUME support [PR106654]

2022-10-12 Thread Andrew MacLeod via Gcc-patches
On 10/12/22 06:15, Jakub Jelinek wrote: the ranges we calculated above for the function. Or some special pass that reads assumes, does the processing you mention above and applies it?  Is that what you are thinking? The options would be to evaluate it each time ranger processes .ASSUME, or t

Re: [PATCH] middle-end IFN_ASSUME support [PR106654]

2022-10-12 Thread Jakub Jelinek via Gcc-patches
On Tue, Oct 11, 2022 at 02:05:52PM -0400, Andrew MacLeod wrote: > > Aldy, could ranger handle this? If it sees .ASSUME call, > > walk the body of such function from the edge(s) to exit with the > > assumption that the function returns true, so above set _2 [true, true] > > and from there derive th

Re: [PATCH] middle-end IFN_ASSUME support [PR106654]

2022-10-11 Thread Andrew MacLeod via Gcc-patches
On 10/10/22 04:54, Jakub Jelinek via Gcc-patches wrote: Hi! My earlier patches gimplify the simplest non-side-effects assumptions into if (cond) ; else __builtin_unreachable (); and throw the rest on the floor. The following patch attempts to do something with the rest too. For -O0, it actuall

Re: [PATCH] middle-end IFN_ASSUME support [PR106654]

2022-10-10 Thread Jakub Jelinek via Gcc-patches
On Mon, Oct 10, 2022 at 05:09:29PM -0400, Jason Merrill wrote: > On 10/10/22 04:54, Jakub Jelinek via Gcc-patches wrote: > > My earlier patches gimplify the simplest non-side-effects assumptions > > into if (cond) ; else __builtin_unreachable (); and throw the rest > > on the floor. > > The followi

Re: [PATCH] middle-end IFN_ASSUME support [PR106654]

2022-10-10 Thread Jason Merrill via Gcc-patches
On 10/10/22 04:54, Jakub Jelinek via Gcc-patches wrote: Hi! My earlier patches gimplify the simplest non-side-effects assumptions into if (cond) ; else __builtin_unreachable (); and throw the rest on the floor. The following patch attempts to do something with the rest too. For -O0, it actually

[PATCH] middle-end IFN_ASSUME support [PR106654]

2022-10-10 Thread Jakub Jelinek via Gcc-patches
Hi! My earlier patches gimplify the simplest non-side-effects assumptions into if (cond) ; else __builtin_unreachable (); and throw the rest on the floor. The following patch attempts to do something with the rest too. For -O0, it actually throws even the simplest assumptions on the floor, we don'