This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Loop distribution for nested Loops.
- From: Ajit Kumar Agarwal <ajit dot kumar dot agarwal at xilinx dot com>
- To: Jeff Law <law at redhat dot com>, Richard Biener <richard dot guenther at gmail dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Cc: Vinod Kathail <vinodk at xilinx dot com>, Shail Aditya Gupta <shailadi at xilinx dot com>, Vidhumouli Hunsigida <vidhum at xilinx dot com>, "Nagaraju Mekala" <nmekala at xilinx dot com>
- Date: Tue, 4 Aug 2015 14:04:29 +0000
- Subject: Loop distribution for nested Loops.
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; gcc.gnu.org; dkim=none (message not signed) header.d=none;
All:
For the Loop given in Fig(1), there is no possibility of loop distribution because of the dependency of S1 and S2 on the outerloop index k.
Due to the dependency the Loop cannot be distributed.
The Loop can be distributed with the transformation given in Fig(2) where the loop given in Fig(1) is distributed due to the dependency
Hoisting transformation. The Dependency hoisting transformation where the dependency is shifted to insertion of new outer Loop and the
Dependency is based on the inserted outerloop. This makes the loop k(S1) and j(S2) distributed with the insertion of new outerloop and transfer
The dependency of S1 and S2 to the inserted outer loop.
Do k = 1, n-1
Do I = k+1, n
S1: a(I,k) = a(I,k)/a(k,k)
Enddo
Do j = k+1,n
Do I = k+1,n
S2: a(I,j) = a(I,j) - a(I,k) *a(k,j);
Enddo
Enddo
Enddo
Fig(1)
Do x = 1, n
Do k = 1, x-1
Do I = k+1, n
S2: a(I,x) = a(I,x) - a(I,k) * a(k,x)
Enddo
enddo
Do i = x+1,n
S1: a(I,x) = a(I,x)/a(x,x);
Enddo
Enddo
Fig(2).
The above transformation looks interesting making the candidate of loop distribution of nested loops with the presence of dependency by
Shifting the dependency to new inserted outer loop.
It is useful to have dependency hoisting transformation that makes the loop distribution possible for nested loops
My question is the partitioning based Loop distributed transformation does the distribution of the nested Loops?
Thanks & Regards
Ajit