Detecting Unrolled loops (M Sweger)
6 Jul 1999 12:01:51 -0400

          From comp.compilers

Related articles
Detecting Unrolled loops (1999-07-06)
Re: Detecting Unrolled loops (Quinn Tyler Jackson) (1999-07-10)
Re: Detecting Unrolled loops (Robert Metzger) (1999-07-14)
| List of all articles for this month |

From: (M Sweger)
Newsgroups: comp.compilers
Date: 6 Jul 1999 12:01:51 -0400
Organization: DataHaven Project, Inc (
Keywords: optimize, question, comment

      I'm wondering if during the course of parsing a program that has
code repeated multiple times (unrolled) instead of once using a For
loop whether compiler techniques can detect/find them and reduce them
down to a loop and mark in the tree structure that this is a loop. I
have such a need to do this, but without the need to reduce it down,
just tell me the beginning and end of the loop.

What compiler technique would be able to do this?

        For 1 to 3 DO
                  A:=B; A:=B;
                                        or C:=D;



Note: the statment within the for loop or repeated is not important since
            I know depending on what it is, the compiler can optimize and minimize
            it unless I either turn optimization on, or if I wrote a compiler that
            doesn't optimize to get rid of the repeating code.
[I believe I've seen compilers that reroll loops so they can unroll them
and use software piplining to make them run fast. -John]

Post a followup to this message

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