Re: Backward branches

kugan@ieee.org (kugan)
2 Jan 2004 03:46:42 -0500

          From comp.compilers

Related articles
Backward branches kugan@ieee.org (2003-12-14)
Re: Backward branches torbenm@diku.dk (2003-12-20)
Re: Backward branches haberg@matematik.su.se (2003-12-21)
Re: Backward branches kugan@ieee.org (2004-01-02)
Re: Backward branches vbdis@aol.com (2004-01-09)
Re: Backward branches j.troeger@qut.edu.au (Jens Troeger) (2004-01-12)
Re: Backward branches Robert.Thorpe@antenova.com (Robert Thorpe) (2004-01-16)
| List of all articles for this month |
From: kugan@ieee.org (kugan)
Newsgroups: comp.compilers
Date: 2 Jan 2004 03:46:42 -0500
Organization: http://groups.google.com
References: 03-12-108 03-12-109
Keywords: hardware optimize
Posted-Date: 02 Jan 2004 03:46:42 EST

torbenm@diku.dk (Torben Ęgidius Mogensen) wrote in message news:03-12-109...
> kugan@ieee.org (kugan) writes:
>
> > I need to detect loops using H/W. I am wondering whether it is
> > possible to detect loops just by detecting backward branches. What
> > would be the approximate success rate for this scheme? What are the
> > other instances where backward branches will be used?
>
> Any loop (that hasn't been fully unrolled) will certainly involve a
> backwards branch at some point. Not all backwards branches are loops,
> though. If you reorder basic blocks, you can well have one branch of
> an if-then-else placed after the join-point, so you need a backwards
> jump to get to the join-point. Jumps to exception-handling code can
> also be backwards, but compilers would tend to make these forwards as
> some branch predictors assume backwards branches are taken (until they
> have gathered evidence to the contrary).


Actually I am trying to implement a kind of loop cache where I need to
detect loops dynamically with high accuracy (occasional miss
predictions will result is performance degrading, but acceptable)


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.


So, from what I understood from your reply, it should work (leaving
the exception) without any compiler assistance. Is it correct?


Kugan


Post a followup to this message

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