profile based loop predication

Roland Westrelin rwestrel at
Fri Mar 3 15:28:05 UTC 2017

Here is another somewhat experimental change. We found that sometimes,
shenandoah barriers would be kept in inner loops because they depend on
null checks that themselves are not hoisted. The reason for that is that
loop predication only looks at predicates (such as null checks) that are
executed in every iterations of the loop. I supposed the rational is
that we don't want a rarely executed predicate to be moved out of loop
and becomes more frequently executed. This change uses profiling to
estimate whether moving the predicate out of loop is expected to pay
off: it looks at every paths in the loop body for a predicate, evaluates
the frequency of the path and uses an the number of iterations in the
loop (again evaluated from profiling data) to decide whether hoisting a
predicate is safe. This is applied to the 2 inner most loops of a loop


More information about the shenandoah-dev mailing list