Re: [trans-mem] Do not instrument thread locals

2012-01-26 Thread Aldy Hernandez
On 01/25/12 14:16, Richard Henderson wrote: On 01/25/2012 01:30 PM, Patrick Marlier wrote: From my point of view, no. When it is a thread local, it should not be shared to someone else. If the thread dies, what happens to the thread local variable? Should it be discarded completely and this pie

Re: [trans-mem] Do not instrument thread locals

2012-01-25 Thread Andi Kleen
> And it's entirely likely that I'd thought of exactly that two years > ago when the DECL_THREAD_LOCAL test was omitted from that bit of code, > but I failed to add a comment. > > I guess this patch needs to be reverted... It may be still a valid optimization, but only if you know there is no esc

Re: [trans-mem] Do not instrument thread locals

2012-01-25 Thread Richard Henderson
On 01/25/2012 01:30 PM, Patrick Marlier wrote: > From my point of view, no. When it is a thread local, it should not > be shared to someone else. If the thread dies, what happens to the > thread local variable? Should it be discarded completely and this > piece of memory never reallocated? Even if

Re: [trans-mem] Do not instrument thread locals

2012-01-24 Thread Patrick Marlier
On 01/24/2012 08:32 PM, Andi Kleen wrote: Hi, > > I found that all thread local variables are instrumented with > _ITM_W/R* calls whereas they should not be shared with other > threads. This patch takes care of thread locals into requires_barrier > and also adds the local save/restore for the

Re: [trans-mem] Do not instrument thread locals

2012-01-24 Thread Andi Kleen
Patrick Marlier writes: > Hi, > > I found that all thread local variables are instrumented with > _ITM_W/R* calls whereas they should not be shared with other > threads. This patch takes care of thread locals into requires_barrier > and also adds the local save/restore for them. This patch also >

Re: [trans-mem] Do not instrument thread locals

2012-01-24 Thread Aldy Hernandez
On 01/24/12 01:34, Richard Henderson wrote: On 01/24/2012 09:59 AM, Patrick Marlier wrote: 2012-01-23 Patrick Marlier * trans-mem.c (requires_barrier): Do not instrument thread local variables and emit save/restore for them. testsuite/ChangeLog 2012-01-23 Patrick Marlier

Re: [trans-mem] Do not instrument thread locals

2012-01-23 Thread Richard Henderson
On 01/24/2012 09:59 AM, Patrick Marlier wrote: > 2012-01-23 Patrick Marlier > > * trans-mem.c (requires_barrier): Do not instrument thread local > variables and emit save/restore for them. > > testsuite/ChangeLog > 2012-01-23 Patrick Marlier > > * gcc.dg/tm/threadlocal-1.

[trans-mem] Do not instrument thread locals

2012-01-23 Thread Patrick Marlier
Hi, I found that all thread local variables are instrumented with _ITM_W/R* calls whereas they should not be shared with other threads. This patch takes care of thread locals into requires_barrier and also adds the local save/restore for them. This patch also includes a testcase. I did not f