RE: No TBAA before ptr_derefs_may_alias_p?

2014-02-03 Thread Bingfeng Mei
@gcc.gnu.org Subject: RE: No TBAA before ptr_derefs_may_alias_p? On January 31, 2014 6:01:36 PM GMT+01:00, Bingfeng Mei b...@broadcom.com wrote: Unfortunately this patch doesn't work because the memory dependency is Anti in this case. Why TBAA cannot handle anti- output- dependencies? I check GCC

Re: No TBAA before ptr_derefs_may_alias_p?

2014-02-03 Thread Jakub Jelinek
On Mon, Feb 03, 2014 at 09:51:01AM +, Bingfeng Mei wrote: If it is just for C++ placement new, why don't implement it as a lang_hook. Now other languages such as C have to be made conservative and produce worse code. Even in C++ code you don't use placement new that often, so e.g. by

Re: No TBAA before ptr_derefs_may_alias_p?

2014-02-03 Thread Florian Weimer
On 02/03/2014 10:59 AM, Jakub Jelinek wrote: On Mon, Feb 03, 2014 at 09:51:01AM +, Bingfeng Mei wrote: If it is just for C++ placement new, why don't implement it as a lang_hook. Now other languages such as C have to be made conservative and produce worse code. Even in C++ code you don't

Re: No TBAA before ptr_derefs_may_alias_p?

2014-02-03 Thread Richard Biener
On Mon, 3 Feb 2014, Jakub Jelinek wrote: On Mon, Feb 03, 2014 at 09:51:01AM +, Bingfeng Mei wrote: If it is just for C++ placement new, why don't implement it as a lang_hook. Now other languages such as C have to be made conservative and produce worse code. But if you combine a C++

Re: No TBAA before ptr_derefs_may_alias_p?

2014-02-03 Thread Richard Biener
On Mon, 3 Feb 2014, Florian Weimer wrote: On 02/03/2014 10:59 AM, Jakub Jelinek wrote: On Mon, Feb 03, 2014 at 09:51:01AM +, Bingfeng Mei wrote: If it is just for C++ placement new, why don't implement it as a lang_hook. Now other languages such as C have to be made conservative

Re: No TBAA before ptr_derefs_may_alias_p?

2014-02-03 Thread Richard Biener
On Mon, 3 Feb 2014, Richard Biener wrote: And note that for the case in question we can derive non-aliasing because with p[i] += q[i]; p[i] is both read _and_ written in the same iteration thus it cannot have the dynamic type of q[i] before it's stored into. Of course data-dependence

RE: No TBAA before ptr_derefs_may_alias_p?

2014-02-03 Thread Bingfeng Mei
Weimer Cc: Jakub Jelinek; Bingfeng Mei; gcc@gcc.gnu.org Subject: Re: No TBAA before ptr_derefs_may_alias_p? On Mon, 3 Feb 2014, Florian Weimer wrote: On 02/03/2014 10:59 AM, Jakub Jelinek wrote: On Mon, Feb 03, 2014 at 09:51:01AM +, Bingfeng Mei wrote: If it is just for C++ placement new

RE: No TBAA before ptr_derefs_may_alias_p?

2014-02-03 Thread Bingfeng Mei
Subject: Re: No TBAA before ptr_derefs_may_alias_p? On Mon, 3 Feb 2014, Richard Biener wrote: And note that for the case in question we can derive non-aliasing because with p[i] += q[i]; p[i] is both read _and_ written in the same iteration thus it cannot have the dynamic type of q[i] before

RE: No TBAA before ptr_derefs_may_alias_p?

2014-02-03 Thread Richard Biener
Subject: Re: No TBAA before ptr_derefs_may_alias_p? On Mon, 3 Feb 2014, Florian Weimer wrote: On 02/03/2014 10:59 AM, Jakub Jelinek wrote: On Mon, Feb 03, 2014 at 09:51:01AM +, Bingfeng Mei wrote: If it is just for C++ placement new, why don't implement it as a lang_hook. Now

RE: No TBAA before ptr_derefs_may_alias_p?

2014-02-03 Thread Bingfeng Mei
[mailto:rguent...@suse.de] Sent: 03 February 2014 13:16 To: Bingfeng Mei Cc: Florian Weimer; Jakub Jelinek; gcc@gcc.gnu.org Subject: RE: No TBAA before ptr_derefs_may_alias_p? On Mon, 3 Feb 2014, Bingfeng Mei wrote: For the following code, why can load be moved before store instruction? TBAA still

RE: No TBAA before ptr_derefs_may_alias_p?

2014-02-03 Thread Richard Biener
already have done that (PR60043) Richard. Bingfeng -Original Message- From: Richard Biener [mailto:rguent...@suse.de] Sent: 03 February 2014 13:16 To: Bingfeng Mei Cc: Florian Weimer; Jakub Jelinek; gcc@gcc.gnu.org Subject: RE: No TBAA before ptr_derefs_may_alias_p? On Mon, 3 Feb

No TBAA before ptr_derefs_may_alias_p?

2014-01-31 Thread Bingfeng Mei
Hi, I got this simple example to vectorize. Somehow, GCC (4.8) generates loop version because it cannot determine alias between acc[i] write and x[i].real read. It is pretty obvious to me that they are not aliased based on TBAA information. typedef struct { short real; short imag; }

Re: No TBAA before ptr_derefs_may_alias_p?

2014-01-31 Thread Richard Biener
On 1/31/14 4:02 PM, Bingfeng Mei wrote: Hi, I got this simple example to vectorize. Somehow, GCC (4.8) generates loop version because it cannot determine alias between acc[i] write and x[i].real read. It is pretty obvious to me that they are not aliased based on TBAA information. typedef

RE: No TBAA before ptr_derefs_may_alias_p?

2014-01-31 Thread Bingfeng Mei
Thanks, Richard, I will prepare a patch with test as well as filing a bug. Bingfeng -Original Message- From: Richard Biener [mailto:rguent...@suse.de] Sent: 31 January 2014 15:24 To: Bingfeng Mei; gcc@gcc.gnu.org Subject: Re: No TBAA before ptr_derefs_may_alias_p? On 1/31/14 4:02 PM

RE: No TBAA before ptr_derefs_may_alias_p?

2014-01-31 Thread Bingfeng Mei
@gcc.gnu.org Subject: Re: No TBAA before ptr_derefs_may_alias_p? On 1/31/14 4:02 PM, Bingfeng Mei wrote: Hi, I got this simple example to vectorize. Somehow, GCC (4.8) generates loop version because it cannot determine alias between acc[i] write and x[i].real read. It is pretty obvious to me

RE: No TBAA before ptr_derefs_may_alias_p?

2014-01-31 Thread Richard Biener
location to change by a store. That in turn is the only sensible way of supporting c++ placement new. Richard. Bingfeng -Original Message- From: Richard Biener [mailto:rguent...@suse.de] Sent: 31 January 2014 15:24 To: Bingfeng Mei; gcc@gcc.gnu.org Subject: Re: No TBAA before