RFR: 8263303: C2 compilation fails with assert(found_sfpt) failed: no node in loop that's not input to safepoint [v2]

Vladimir Kozlov kvn at openjdk.java.net
Wed Jun 9 15:35:16 UTC 2021


On Wed, 9 Jun 2021 09:09:42 GMT, Roland Westrelin <roland at openjdk.org> wrote:

>> The loop strip mining verification code catches a node which is pinned
>> in the outer strip mined loop but not referenced from the safepoint
>> node.
>> 
>> The test case is an example of how this could happen. The array[i]
>> load is referenced from the safepoint initially through:
>> 
>> (j - 10) * array[i]
>> 
>> It is sunk out of the inner loop and pinned in the outer loop. A
>> following loop opts round causes j - 10 to constant fold to 0 and as a
>> consequence the array load is no longer referenced from the safepoint
>> but pinned in the outer strip mined loop.
>> 
>> I tried to find a way to preserve the invariant that all nodes in the
>> outer strip mined loop are referenced from the safepoint but found no
>> robust way for that. So the fix removes that part of the verification
>> code.
>> 
>> This requires loop cloning code to be adjusted for nodes pinned in the
>> outer strip mined loop but not referenced from the safepoint.
>
> Roland Westrelin has updated the pull request incrementally with one additional commit since the last revision:
> 
>   remove useless line from test

Yes, we can't assume that all node in outer loop are referenced by Safepoint node. SP nodes reference only live values in current BC. In the test case it is value 'v'. After constant fold `v' become 0 and that is what SF should see (MulNode::Value() optimizes multiplication by 0). array[i] load should be dead at this point since nothing should be referencing it (except GC barriers, may be).

And I don't get how array[i] is moved from inner loop - it depends on `i` - loop's index.

-------------

PR: https://git.openjdk.java.net/jdk/pull/4278


More information about the hotspot-compiler-dev mailing list