Re: [PATCH] ipa-visibility: Optimize TLS access [PR99619]

2022-05-25 Thread Jan Hubicka via Gcc-patches
> On Mon, 16 May 2022, Alexander Monakov wrote: > > > On Mon, 9 May 2022, Jan Hubicka wrote: > > > > > > On second thought, it might be better to keep the assert, and place the > > > > loop > > > > under 'if (optimize)'? > > > > > > The problem is that at IPA level it does not make sense to che

Re: [PATCH] ipa-visibility: Optimize TLS access [PR99619]

2022-05-23 Thread Alexander Monakov via Gcc-patches
On Mon, 16 May 2022, Alexander Monakov wrote: > On Mon, 9 May 2022, Jan Hubicka wrote: > > > > On second thought, it might be better to keep the assert, and place the > > > loop > > > under 'if (optimize)'? > > > > The problem is that at IPA level it does not make sense to check > > optimize fl

Re: [PATCH] ipa-visibility: Optimize TLS access [PR99619]

2022-05-16 Thread Alexander Monakov via Gcc-patches
On Mon, 9 May 2022, Jan Hubicka wrote: > > On second thought, it might be better to keep the assert, and place the loop > > under 'if (optimize)'? > > The problem is that at IPA level it does not make sense to check > optimize flag as it is function specific. (shlib is OK to check it > anywhere

Re: [PATCH] ipa-visibility: Optimize TLS access [PR99619]

2022-05-09 Thread Alexander Monakov
On Mon, 9 May 2022, Jan Hubicka wrote: > > On second thought, it might be better to keep the assert, and place the loop > > under 'if (optimize)'? > > The problem is that at IPA level it does not make sense to check > optimize flag as it is function specific. (shlib is OK to check it > anywhere

Re: [PATCH] ipa-visibility: Optimize TLS access [PR99619]

2022-05-09 Thread Jan Hubicka via Gcc-patches
> On Mon, 2 May 2022, Alexander Monakov wrote: > > > > --- a/gcc/ipa-visibility.cc > > > > +++ b/gcc/ipa-visibility.cc > > > > @@ -872,6 +872,22 @@ function_and_variable_visibility (bool > > > > whole_program) > > > > } > > > > } > > > > } > > > > + FOR_EACH_VARIABLE (vno

Re: [PATCH] ipa-visibility: Optimize TLS access [PR99619]

2022-05-09 Thread Alexander Monakov
On Mon, 2 May 2022, Alexander Monakov wrote: > > > --- a/gcc/ipa-visibility.cc > > > +++ b/gcc/ipa-visibility.cc > > > @@ -872,6 +872,22 @@ function_and_variable_visibility (bool whole_program) > > > } > > > } > > > } > > > + FOR_EACH_VARIABLE (vnode) > > > +{ > > > + tree de

Re: [PATCH] ipa-visibility: Optimize TLS access [PR99619]

2022-05-05 Thread Alexander Monakov
On Thu, 5 May 2022, Jan Hubicka wrote: > > It follows from how local-dynamic model is defined: we call __tls_get_addr > > with an argument that identifies the current DSO (not the individual > > thread-local variable), and then compute the address of the variable with > > a simple addition, so whe

Re: [PATCH] ipa-visibility: Optimize TLS access [PR99619]

2022-05-05 Thread Jan Hubicka via Gcc-patches
> On Thu, 5 May 2022, Jan Hubicka wrote: > > > Also note that visibility pass is run twice (once at compile time before > > early optimizations and then again at LTO). Since LTO linking may > > promote public symbols to local/hidden, perhaps we want to do this only > > second time the pass is exec

Re: [PATCH] ipa-visibility: Optimize TLS access [PR99619]

2022-05-05 Thread Alexander Monakov
On Thu, 5 May 2022, Jan Hubicka wrote: > Also note that visibility pass is run twice (once at compile time before > early optimizations and then again at LTO). Since LTO linking may > promote public symbols to local/hidden, perhaps we want to do this only > second time the pass is executed? The f

Re: [PATCH] ipa-visibility: Optimize TLS access [PR99619]

2022-05-05 Thread Jan Hubicka via Gcc-patches
> > @@ -872,6 +872,22 @@ function_and_variable_visibility (bool whole_program) > > } > > } > > } > > + FOR_EACH_VARIABLE (vnode) > > +{ > > + tree decl = vnode->decl; > > + > > + /* Optimize TLS model based on visibility (taking into account > > + optim

Re: [PATCH] ipa-visibility: Optimize TLS access [PR99619]

2022-05-02 Thread Martin Liška
On 5/2/22 18:04, Martin Jambor wrote: > (Minor nit and I don't care too much, but in GCC we traditionally > specify co-authors in the ChangeLog entry beginning by providing more > names, one per line. But perhaps we want to adapt more widely used > practices.) Hello. Using Co-Authored-By is fine

Re: [PATCH] ipa-visibility: Optimize TLS access [PR99619]

2022-05-02 Thread Alexander Monakov
On Mon, 2 May 2022, Martin Jambor wrote: > > Co-Authored-By: Alexander Monakov > > (Minor nit and I don't care too much, but in GCC we traditionally > specify co-authors in the ChangeLog entry beginning by providing more > names, one per line. But perhaps we want to adapt more widely used > p

Re: [PATCH] ipa-visibility: Optimize TLS access [PR99619]

2022-05-02 Thread Martin Jambor
Hello, On Sun, Apr 17 2022, Artem Klimov via Gcc-patches wrote: > Fix issue PR99619, which asks to optimize TLS access based on > visibility. The fix is implemented as an IPA optimization, which allows > to take optimized visibility status into account (as well as avoid > modifying all language fr

Re: [PATCH] ipa-visibility: Optimize TLS access [PR99619]

2022-05-02 Thread Alexander Monakov
Hi, I'd like to ping this patch on behalf of Artem. Alexander On Sun, 17 Apr 2022, Artem Klimov wrote: > Fix issue PR99619, which asks to optimize TLS access based on > visibility. The fix is implemented as an IPA optimization, which allows > to take optimized visibility status into account (as

[PATCH] ipa-visibility: Optimize TLS access [PR99619]

2022-04-17 Thread Artem Klimov via Gcc-patches
Fix issue PR99619, which asks to optimize TLS access based on visibility. The fix is implemented as an IPA optimization, which allows to take optimized visibility status into account (as well as avoid modifying all language frontends). 2022-04-17 Artem Klimov gcc/ChangeLog: PR middle-e