Re: Getting GCC to software pipeline loops

sanjay@equalizer.cray.com (+Sanjay Krishnamurthy)
Tue, 13 Oct 1992 02:20:19 GMT

          From comp.compilers

Related articles
Re: Getting GCC to software pipeline loops sanjay@equalizer.cray.com (1992-10-13)
re: GCC Software Pipelining hedley@iit.com (1992-10-17)
| List of all articles for this month |
Newsgroups: comp.compilers
From: sanjay@equalizer.cray.com (+Sanjay Krishnamurthy)
Organization: Compilers Central
Date: Tue, 13 Oct 1992 02:20:19 GMT
Keywords: optimize, GCC

>For my studies in cache memories I need a compiler which performs the
>SOFTWARE PIPELINING transformation to the code. [How do I make GCC do that?]


What you already have in GCC is some form of instruction scheduling within
basic blocks. I would recommend adding some stuff which I elaborate below
to enhance this scheduler to pipeline code. Minimum perturbation is the
name of the game.


I will concentrate on pipelining loops with subscripted variable accesses
dominating the references in the loop. You would first have to add some
mechanism to GCC to disambiguate memory references. Lets say you settle
for annotating the RTL such that every memory reference in a candidate
loop has its subscripting function appended to it. You will have to carry
loop bound information along too. There are a bunch of simple tests for
dependence analysis summarized in the paper "Efficient and exact
dependence data dependence analysis," D.E.Maydan, J.L.Hennessy and
M.S.Lam, SIGPLAN'91. Or if you are too lazy, get Michael Wolfe's Tiny
restructuring tool and use the dependence tests in it. After this first
step, you will (hopefully) have a dependence graph with either direction
or distance information. You are just one small step away from pipelining
the loop.


What you need now is a schedule of instructions which respects all the
dependence edges. The simplest schedule obeying this constraint can be
found by using a form of list scheduling-schedule a guy ASAP ignoring all
forms of resource constraints (huh, you might say. Hang on dude...)


Hand the above schedule to the GCC scheduler which will then generate the
final form of the pipelined loop.


I am not sure what you mean by "without too much hustle." Does this
qualify??


Just wondering...
-Sanjay M. Krishnamurthy
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.