This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Problems with a patch to improve dependence analysis


 

> -----Original Message-----
> From: Dorit Nuzman [mailto:DORIT@il.ibm.com] 
> Sent: Sunday, July 15, 2007 1:14 PM
> To: Sjodin, Jan
> Cc: gcc-patches@gcc.gnu.org; Ira Rosen
> Subject: Re: Problems with a patch to improve dependence analysis
> 
[snip]
> 
> By the way, IIUC you currently represent (A+k)[i][j] as:
>   DR_BASE_ADDRESS = &A+k
>   DR_BASE_OFFSET = i*D+j

This is how it is currently represented. k in my case corresponds to D. 

> What if instead you'd split DR_BASE_ADDRESS further (probably 
> by going through get_inner_reference again) into:
>   DR_BASE_ADDRESS = &A
>   DR_BASE_OFFSET = k+i*D+j

This is what it looks like with the patch assuming k is a constant. If k
is not constant it will remain in DR_BASE_ADDRESS. Perhaps it should be
split for variables in some cases.

I have a question about efficiency. If the base address is a complex
computation it may get duplicated. For example:
(1) b1 = b0 + D;
(2) b2 = b1 + q;
(3) b3 = b0 + q;
(4) b2[i][j] = b3[i][j] + b3[i][j];

BASE_ADDRESS(b2): b0+q
BASE_OFFSET(b2): i*D+j+D

BASE_ADDRESS(b3): b0+q
BASE_OFFSET(b3): i*D+j

Will the base address b0+q be emitted three times if statement (4) is
vectorized? I assume CSE takes care of it eventually, but there are some
passes that run before CSE and the heuristics may be sensitive to the
extra statements. On the positive side these two cases now work:
XPASS: gcc.dg/vect/vect-74.c scan-tree-dump-times vectorized 1 loops 1
XPASS: gcc.dg/vect/vect-80.c scan-tree-dump-times vectorized 1 loops 1

- Jan



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]