Loop safepoints and backedge copies
Tom Rodriguez
Thomas.Rodriguez at Sun.COM
Mon Mar 23 13:39:59 PDT 2009
> That's interesting, what is it that determines whether a backedge is
> cloned or not? And also, out of interest, what benefit does having
> the backedge copies bring?
The cloning in ciTypeFLow is really just a helper to get loop shapes
nicer at the beginning of parse. It's converting relatively simply
loops into what's often called a zero trip loop, which is basically a
guarded do/while. So this, which is just a translation of a for loop:
int i = 0;
while (i < n) {
body();
i++;
}
becomes:
int i = 0;
if (i < n) {
do {
body();
i++;
while (i < n);
}
The nice thing about this is that it provide a place for loop
invariant values to be computed where it's guaranteed that you will
execute the body at least one.
In ciTypeFlow this is don't for simply loops only. Check out
is_clonable_exit.
tom
>
>
> Cheers,
> Gary
>
> --
> http://gbenson.net/
More information about the hotspot-compiler-dev
mailing list