RFR(S): 8229483: Sinking load out of loop may trigger: assert(found_sfpt) failed: no node in loop that's not input to safepoint
rwestrel at redhat.com
Tue Aug 27 09:23:57 UTC 2019
The field load in the test case has an early control right below:
barrier = 1;
(it's a volatile store)
and a late control that's conservatively set to be right above:
array = j;
by anti dependence analysis.
The store array is sunk out of the inner loop in the outer strip
mined loop right above the strip mined loop's safepoint. The load
initially scheduled in the outer loop is a candidate for being cloned
and sunk out of loop at the load usages. Because of the anti-dependence
with the array, it is sunk into the outer strip mined loop eventhough
it is not referenced by the safepoint. That breaks loop strip mining
verification because the expectation is that any data node in the outer
strip mined loop is there because it's referenced by the safepoint.
The fix simply recognizes this special case when the load is being sunk
out of loop and makes sure it is not moved in the outer strip mined
Unrelated to this fix, I wonder if the code at:
really does what the comment says it does for loads (and really does
anything useful actually).
Late control for the load is computed with:
late_load_ctrl = get_late_ctrl(n, n_ctrl);
to make sure anti dependences are taken into account. But if a load is
in a loop, it's because it has uses outside the loop. So late control
for the load is in the loop too. When sinking the load, the restriction
is that clones should not float below late control, then clones are
going to stay in the loop. And that code doesn't do anything for
loads. Or am I missing something?
More information about the hotspot-compiler-dev