RFR(S): 8244086: Following 8241492, strip mined loop may run extra iterations
Roland Westrelin
rwestrel at redhat.com
Mon May 4 07:28:55 UTC 2020
Hi Martin,
> my idea was rather to check if the trip counter is already checked before the loop.
> Check before loop should look like this (stride > 0 example):
> CmpINode c = CountedLoop->in(1) -> IfTrue->in(0) -> If->in(1) -> Bool->in(1) -> CompI
>
> (Maybe there's an easier way to find it where it gets generated.)
>
> Comparison of start value:
> c->in(1) == Phi(trip counter)->in(1)
> with limit:
> c->in(2) == CmpI(trip counter)->in(2)
>
> If this matches we should be safe.
> I haven't checked if such patterns match often enough. Just as an idea.
The code snippet I included does that but in a slightly different way
(it looks for the CmpI/Bool with the right inputs and checks that it
dominates the loops). That works for simple loops but I found it doesn't
for other common loop shapes. So I doubt it's a as simple as it seems to
follow your suggestion.
Roland.
More information about the hotspot-compiler-dev
mailing list