This is the mail archive of the
mailing list for the GCC project.
Proposal for inter-procedural loops fusion.
- From: Ajit Kumar Agarwal <ajit dot kumar dot agarwal at xilinx dot com>
- To: Jeff Law <law at redhat dot com>, Jan Hubicka <hubicka at ucw dot cz>, 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: Sun, 8 Mar 2015 06:46:33 +0000
- Subject: Proposal for inter-procedural loops fusion.
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=pass (sender IP is 184.108.40.206) smtp dot mailfrom=ajit dot kumar dot agarwal at xilinx dot com; gmail.com; dkim=none (message not signed) header.d=none;
I am proposing the inter-procedural Loop fusion. Generally the Loops adjacent to each other and the conformable
Candidates of loop fusions are done with respect to intra-procedural loops. The whole program analysis needs to
Be done with array sections analysis across the procedure calls to fuse the loops across the procedure calls.
In the example given in Fig(1) the doubly nested loops in routine sub1 will be a candidates of fusing the doubly
Nested loops in routine sub2 in Fig(2). The main calls routine sub1 and sub2 and the loops in routine sub1 and sub2
Can be fused. The array section analysis and dependence analysis is done on the regions across the procedure calls
For loops in sub1 and sub2.
Here is the proposal for loop fusion across the procedure calls. Normally loop peeling is done to make the candidate
For Loop fusion and the sub2 function the loops can also be peeled.
In the examples given below the array A and array B are global variables in order to happen the loops fusion across
the procedure calls.
The below examples are extracted from the articles on the following.
"Inter-procedure loop fusion, array compaction and rotation" by John Ng et.al
common /s/ A(N),B(N)
Subroutine sub1() common /s/ A(N),B(N)Â
Â do i=1,NÂ
Â Â ÂA(i+1, j) = j -i
Â Â enddoÂ
A(1,i) = i * 2
A(i+1,n+1) = A(i+1,1)
end /* sub1 */
ÂSubroutine sub2() common /s/ A(N),B(N)
Â Â do i=1,N
Â Â Â ÂB(i,j) = A(i+1,j+1) +A(i,j+1) + A(i,j) +A(i+1,j)Â
Â Â Âenddo
Thanks & Regards