Re: Backward branches (VBDis)
9 Jan 2004 23:45:13 -0500

          From comp.compilers

Related articles
Backward branches (2003-12-14)
Re: Backward branches (2003-12-20)
Re: Backward branches (2003-12-21)
Re: Backward branches (2004-01-02)
Re: Backward branches (2004-01-09)
Re: Backward branches (Jens Troeger) (2004-01-12)
Re: Backward branches (Robert Thorpe) (2004-01-16)
| List of all articles for this month |

From: (VBDis)
Newsgroups: comp.compilers
Date: 9 Jan 2004 23:45:13 -0500
Organization: AOL Bertelsmann Online GmbH & Co. KG
References: 04-01-020
Keywords: optimize, architecture
Posted-Date: 09 Jan 2004 23:45:13 EST (kugan) schreibt:

>And also, I don't need to detect if-then-else loop, because this will
>execute only once. What I need to detect is "while loop", "for loop"
>etc. As I said earlier, I can ignore exception, as it would happen
>less frequently.

Perhaps you should clarify some terms:

What do you mean by "detect loops using H/W"? Hardware?

Why do you consider if-then-else as loops?

Do you want to do a static or a dynamic analysis?

One of the principles of control flow analysis is the abstraction from
physical addresses, so that the arrangement of sequential code in
memory becomes unimportant. That abstraction is important for any
compiled code, since modern compilers may arrange the code in a
most-probable-next-target order, regardless of the static structure of
the source code. A loop then exists when a jump goes to a node which
has already been visited before, during the analysis of the control
flow graph. Dead code, and consequently jumps never taken, is
eliminated by control flow analysis. More code can be eliminated when
conditions can be detected as being always true/false.

In a dynamic analysis (cache implementation...) a peephole optimizer
with an LRU algorithm can be used, so that the Least Recently Used
parts of the code will remain in the cache, regardless of any jump


Post a followup to this message

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