RFR: 8282045: When loop strip mining fails, safepoints are removed from loop anyway

Roland Westrelin roland at openjdk.java.net
Thu Feb 17 10:08:42 UTC 2022


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.

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

Commit messages:
 - whitespaces
 - fix & test

Changes: https://git.openjdk.java.net/jdk/pull/7513/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7513&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8282045
  Stats: 193 lines in 3 files changed: 166 ins; 24 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7513.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7513/head:pull/7513

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


More information about the hotspot-compiler-dev mailing list