Re: read_only access attribute as optimizer hint

2022-09-07 Thread Richard Biener via Gcc
On Wed, Sep 7, 2022 at 1:37 PM Henrik Holst wrote: > > > > Den ons 7 sep. 2022 kl 09:48 skrev Richard Biener > : >> >> On Tue, Sep 6, 2022 at 5:19 PM Henrik Holst >> wrote: >> > >> > >> > >> > Den tis 6 sep. 2022 kl 16:47 skrev Richard Biener >> > : >> >> >> >> >> >> >> >> > Am 06.09.2022 um 16

Re: read_only access attribute as optimizer hint

2022-09-07 Thread Henrik Holst
Den ons 7 sep. 2022 kl 09:48 skrev Richard Biener < richard.guent...@gmail.com>: > On Tue, Sep 6, 2022 at 5:19 PM Henrik Holst > wrote: > > > > > > > > Den tis 6 sep. 2022 kl 16:47 skrev Richard Biener < > richard.guent...@gmail.com>: > >> > >> > >> > >> > Am 06.09.2022 um 16:23 schrieb Henrik Ho

Re: read_only access attribute as optimizer hint

2022-09-07 Thread Richard Biener via Gcc
On Tue, Sep 6, 2022 at 5:19 PM Henrik Holst wrote: > > > > Den tis 6 sep. 2022 kl 16:47 skrev Richard Biener > : >> >> >> >> > Am 06.09.2022 um 16:23 schrieb Henrik Holst : >> > >> > Hi all, >> > >> > is there any reason why the access attribute is not used as hints to the >> > optimizer? >> >

Re: read_only access attribute as optimizer hint

2022-09-06 Thread Henrik Holst
Den tis 6 sep. 2022 kl 16:47 skrev Richard Biener < richard.guent...@gmail.com>: > > > > Am 06.09.2022 um 16:23 schrieb Henrik Holst < > henrik.ho...@millistream.com>: > > > > Hi all, > > > > is there any reason why the access attribute is not used as hints to the > > optimizer? > > > > If we ta

Re: read_only access attribute as optimizer hint

2022-09-06 Thread Richard Biener via Gcc
> Am 06.09.2022 um 16:23 schrieb Henrik Holst : > > Hi all, > > is there any reason why the access attribute is not used as hints to the > optimizer? > > If we take this ancient example: > > void foo(const int *); > > int bar(void) > { >int x = 0; >int y = 0; > >for (int i =

read_only access attribute as optimizer hint

2022-09-06 Thread Henrik Holst
Hi all, is there any reason why the access attribute is not used as hints to the optimizer? If we take this ancient example: void foo(const int *); int bar(void) { int x = 0; int y = 0; for (int i = 0; i < 10; i++) { foo(&x); y += x; // this load not optimized ou