RFR: 8281322: C2: always construct strip mined loop initially (even if strip mining is disabled) [v3]

Roland Westrelin roland at openjdk.java.net
Mon Mar 7 17:05:19 UTC 2022


> Some of the long range check transformations take advantage of the
> safepoint captured by loop strip mining to extract jvm state (in order
> to add back empty predicates to the inner loop of a loop nest). As a
> consequence, irTests/TestLongRangeChecks.java fails with strip mining
> off and users might experience performance anomalies where changing
> GCs affect purely computational code.
> 
> The strip mined loop nest creation is a 2 step process:
> 
> 1- when a CountedLoop is created, an OuterStripMinedLoop is also added
>   but it's not fully constructed
> 
> 2- at macro expansion time, the OuterStripMinedLoop is turned into an
>   actual loop by adding Phis and a proper exit condition
> 
> I propose always doing 1- whether loop strip mining is enabled or
> not. This causes the safepoint to always be captured. Loop strip ming
> is not expected to get in the way of loop transformations so this
> change in itself should be performance neutral. Then at 2-, if loop
> strip mining is not enabled, the OuterStripMinedLoop can be removed
> and the safepoint moved back into the loop in case
> LoopStripMiningIter=1 or simply removed too.

Roland Westrelin has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 14 commits:

 - Merge branch 'master' into JDK-8281322
 - more
 - Merge branch 'master' into JDK-8281322
 - more
 - cleanup
 - merge fix
 - Merge branch 'master' into JDK-8281322
 - more
 - more
 - more
 - ... and 4 more: https://git.openjdk.java.net/jdk/compare/ef266d77...e277b7d1

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

Changes: https://git.openjdk.java.net/jdk/pull/7364/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7364&range=02
  Stats: 478 lines in 4 files changed: 291 ins; 182 del; 5 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7364.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7364/head:pull/7364

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


More information about the hotspot-compiler-dev mailing list