RFR: 8282045: When loop strip mining fails, safepoints are removed from loop anyway [v2]
Christian Hagedorn
chagedorn at openjdk.java.net
Tue Mar 1 14:37:08 UTC 2022
On Mon, 28 Feb 2022 13:20:41 GMT, Roland Westrelin <roland at openjdk.org> wrote:
>> I noticed that if loop strip mining fails because a safepoint is not
>> found right above the exit test (following partial peel for instance),
>> all safepoints are removed from the loop anyway. That's fixed by the
>> change in IdealLoopTree::counted_loop() where rather than test if loop
>> strip mining is enabled, the check now verifies that loop strip mining
>> was successful.
>>
>> With that change,
>> compiler/c2/irTests/TestAutoVectorization2DArray.java fails. The loop
>> is not converted into a strip mined loop because there's no safepoint
>> above the exit test after partial peeling. The loop strip mining logic
>> is too strict when it comes to the safepoint location. Any safepoint
>> that dominates the exit and is in the loop as long as there's no side
>> effect between the safepoint and the exit can be used. The patch
>> implements that change as well. TestAutoVectorization2DArray.java
>> passes as a result.
>>
>> The existing requirement to have no safepoint on the backedge is too
>> strict as well. If the loop has another safepoint that can be used for
>> strip mining, then the safepoint on the backedge can safely be
>> dropped. That's also implemented by the patch.
>
> Roland Westrelin has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
>
> - review
> - Merge branch 'master' into JDK-8282045
> - whitespaces
> - fix & test
Looks good to me!
-------------
Marked as reviewed by chagedorn (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/7513
More information about the hotspot-compiler-dev
mailing list