RFR: 8254887: C2: assert(cl->trip_count() > 0) failed: peeling a fully unrolled loop [v2]

Roland Westrelin roland at openjdk.java.net
Thu Nov 12 15:22:15 UTC 2020


> A loop's trip count is computed to have exact trip count 6. Then:
> 
> 1- pre/main/post loops are created which brings the trip count from 6
>   to 5
> 2- main loop is unrolled which brings the trip count to 2
> 3- main loop is peeled: Trip count is 1
> 4- pre/main/post loops are created again. Trip count of main loop is 0.
> 5- peeling is attempted again and the assert fires
> 
> IdealLoopTree::policy_peeling() doesn't attempt peeling if the trip
> count is 1. I propose that IdealLoopTree::policy_range_check() (that
> causes the pre/main/post loops insertion the second time) performs the
> same check so step 4 doesn't happen.

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

 - only for normal loops
 - test
 - fix

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

Changes: https://git.openjdk.java.net/jdk/pull/1096/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1096&range=01
  Stats: 64 lines in 2 files changed: 63 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1096.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1096/head:pull/1096

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


More information about the hotspot-compiler-dev mailing list