Re: Propagate value ranges of return values

2023-11-22 Thread Andrew Pinski
On Tue, Nov 21, 2023 at 6:07 AM Jan Hubicka wrote: > > > After this patch in addition to the problem already reported about > > vlda1.c and return-value-range-1.c, we have noticed these regressions > > on aarch64: > > Running gcc:gcc.target/aarch64/aarch64.exp ... > > FAIL: gcc.target/aarch64/movk

Adjust 'libgomp.c/declare-variant-{3,4}-[...]' for inter-procedural value range propagation (was: Propagate value ranges of return values)

2023-11-22 Thread Thomas Schwinge
Hi! On 2023-11-19T16:05:42+0100, Jan Hubicka wrote: > this is updated version which also adds testuiste compensation > I lost earlier while maintaining the patch in my testing tree. > There are quite few testcases that use constant return values to hide > something from optimizer. One more: comm

Re: Fix 'gcc.dg/tree-ssa/return-value-range-1.c' for 'char' defaulting to 'unsigned' (was: Propagate value ranges of return values)

2023-11-22 Thread Thomas Schwinge
your patch turned ERROR in FAIL) Yes, I have; and I even tried to log in there, to point to my commit mentioned above, which is meant to address this issue -- please let me know if you're still seeing the FAIL after that commit. > Thomas, you said in another email that adding -O2 av

Re: Fix 'gcc.dg/tree-ssa/return-value-range-1.c' for 'char' defaulting to 'unsigned' (was: Propagate value ranges of return values)

2023-11-22 Thread Christophe Lyon
Hi! On Tue, 21 Nov 2023 at 22:24, Thomas Schwinge wrote: > > Hi! > > On 2023-11-19T16:05:42+0100, Jan Hubicka wrote: > > --- /dev/null > > +++ b/gcc/testsuite/gcc.dg/tree-ssa/return-value-range-1.c > > Pushed to master branch commit a0240662b22312ffb3e3fefb85f258ab0e7010f4 > "Fix 'gcc.dg/tree-ss

Re: Propagate value ranges of return values

2023-11-21 Thread Thomas Schwinge
Hi Honza! On 2023-11-21T15:06:54+0100, Jan Hubicka wrote: >> After this patch in addition to the problem already reported about >> vlda1.c and return-value-range-1.c, [...] > return-value_range-1.c should be fixed now and I do not have vlda1.c in > my tree. I will check. Typo, I suppose; proba

Fix 'gcc.dg/tree-ssa/return-value-range-1.c' for 'char' defaulting to 'unsigned' (was: Propagate value ranges of return values)

2023-11-21 Thread Thomas Schwinge
Hi! On 2023-11-19T16:05:42+0100, Jan Hubicka wrote: > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/tree-ssa/return-value-range-1.c Pushed to master branch commit a0240662b22312ffb3e3fefb85f258ab0e7010f4 "Fix 'gcc.dg/tree-ssa/return-value-range-1.c' for 'char' defaulting to 'unsigned'", see attache

Re: Propagate value ranges of return values

2023-11-21 Thread Jan Hubicka
> After this patch in addition to the problem already reported about > vlda1.c and return-value-range-1.c, we have noticed these regressions > on aarch64: > Running gcc:gcc.target/aarch64/aarch64.exp ... > FAIL: gcc.target/aarch64/movk.c scan-assembler movk\tx[0-9]+, 0x4667, lsl 16 > FAIL: gcc.targ

Re: Propagate value ranges of return values

2023-11-21 Thread Christophe Lyon
Hi! On Sun, 19 Nov 2023 at 16:05, Jan Hubicka wrote: > > Hi, > this is updated version which also adds testuiste compensation > I lost earlier while maintaining the patch in my testing tree. > There are quite few testcases that use constant return values to hide > something from optimizer. > > Bo

Re: Fix 'gcc.dg/tree-ssa/return-value-range-1.c' (was: Propagate value ranges of return values)

2023-11-21 Thread Jan Hubicka
> Hi! > > On 2023-11-19T16:05:42+0100, Jan Hubicka wrote: > > --- /dev/null > > +++ b/gcc/testsuite/gcc.dg/tree-ssa/return-value-range-1.c > > @@ -0,0 +1,22 @@ > > +/* { dg-do ling } */ > > ERROR: gcc.dg/tree-ssa/return-value-range-1.c: 1: syntax error for " > dg-do 1 ling " > > With that

Fix 'gcc.dg/tree-ssa/return-value-range-1.c' (was: Propagate value ranges of return values)

2023-11-21 Thread Thomas Schwinge
Hi! On 2023-11-19T16:05:42+0100, Jan Hubicka wrote: > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/tree-ssa/return-value-range-1.c > @@ -0,0 +1,22 @@ > +/* { dg-do ling } */ ERROR: gcc.dg/tree-ssa/return-value-range-1.c: 1: syntax error for " dg-do 1 ling " With that fixed into 'dg-do link',

Re: Propagate value ranges of return values

2023-11-20 Thread Martin Jambor
Hi, thanks for working on this. On Sun, Nov 19 2023, Jan Hubicka wrote: > Hi, > this is updated version which also adds testuiste compensation > I lost earlier while maintaining the patch in my testing tree. > There are quite few testcases that use constant return values to hide > something from

Re: Propagate value ranges of return values

2023-11-20 Thread Jan Hubicka
> > On 11/18/23 20:21, Jan Hubicka wrote: > > Hi, > > this patch implements very basic propaation of return value ranges from VRP > > pass. This helps std::vector's push_back since we work out value range of > > allocated block. This propagates only within single translation unit. I > > hoped

Re: Propagate value ranges of return values

2023-11-20 Thread Andrew MacLeod
On 11/18/23 20:21, Jan Hubicka wrote: Hi, this patch implements very basic propaation of return value ranges from VRP pass. This helps std::vector's push_back since we work out value range of allocated block. This propagates only within single translation unit. I hoped we will also do the pr

Re: Propagate value ranges of return values

2023-11-19 Thread Jan Hubicka
Hi, this is updated version which also adds testuiste compensation I lost earlier while maintaining the patch in my testing tree. There are quite few testcases that use constant return values to hide something from optimizer. Bootstrapped/regtested x86_64-linux. gcc/ChangeLog: * cgraph.cc

Re: Propagate value ranges of return values

2023-11-19 Thread Jan Hubicka
> > +Wsuggest-attribute=returns_nonnull > > - or _? > > (If changing it, needs adjustment in rest of patch too.) I was thinking of this and I am not sure what is better. Sure _ in command line option looks odd, but this is an identifier and it is returns_nonnull and not returns-nonnull. I am not

Re: Propagate value ranges of return values

2023-11-19 Thread Sam James
Jan Hubicka writes: > Hi, > this patch implements very basic propaation of return value ranges from VRP > pass. This helps std::vector's push_back since we work out value range of > allocated block. This propagates only within single translation unit. I > hoped > we will also do the propaga

Propagate value ranges of return values

2023-11-18 Thread Jan Hubicka
Hi, this patch implements very basic propaation of return value ranges from VRP pass. This helps std::vector's push_back since we work out value range of allocated block. This propagates only within single translation unit. I hoped we will also do the propagation at WPA stage, but that needs mor