Dorit Nuzman - Re: [patch] Predictive commoning (original) (raw)

This is the mail archive of the gcc-patches@gcc.gnu.orgmailing 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]

Zdenek Dvorak rakdver@atrey.karlin.mff.cuni.cz wrote on 06/02/2007 23:17:54:

Hello,

this patch implements the predictive commoning optimization (i.e., ...

(this whole discussion on scheduling of complete-unrolling pass relative to vectorization had me thinking): Have you considered scheduling predictive-commoning pass after vectorization? It seems to me that it can transform loops, that are otherwise easy to vectorize, into loops with cross iteration dependencies, which are hard to vectorize. e.g. take this loop as an example:

for (i=0; i<n; i++) c[i] += a[i] * a[i+2];

this should be easily vectorizable, unless predictive-commoning is applied beforehand.

Maybe (although dealing with this particular type of cross-iteration dependence in vectorizer would produce more efficient code, I think).

I think we should really consider scheduling predictive-commoning after vectorization. In xlC they also do predictive commoning after vectorization, precisely because it may introduce loop-carried dependences, and also because it can improve vectorized misaligned accesses (by reusing loads across iterations). In fact, in xlC predictive-commoning is the last loop transformation.

By the way, I tried out a similar testcase:

for (i=0; i<n; i++) c[i] += a[i] * a[i+1];

and this one currently doesn't get vectorized - looks like pre is already doing predictive-commoning for this case before vectorization...

yes, sort of.

any way we could defer this particular pre transformation till after vectorization?

no, unless you want to move also pre after loop optimizations.

well, I wasn't going to suggest that, but interesting idea... :-)

dorit

Zdenek


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