RFR: 8257223: C2: Optimize RegMask::is_bound

Claes Redestad redestad at openjdk.java.net
Mon Nov 30 13:06:08 UTC 2020


- Avoid Size() for is_bound1 (does relatively expensive computations)
- Refactor loops to more efficiently check that the remainder of the mask is empty after a match. (Using the same structure helped gcc merge the control flows in `is_bound` for an additional benefit)

This removes ~80k (~1%) of the C2 bootstrap overhead, and reduces time spent doing Register_Allocate in SimpleRepeatCompilation.largeMethod by about 0.4%. There's a small but statistically insignificant effect (~0.2%) on the score, too:

Benchmark                                      Mode  Cnt     Score    Error  Units
SimpleRepeatCompilation.largeMethod_repeat_c2    ss   20  8119.278 ± 37.803  ms/op
SimpleRepeatCompilation.largeMethod_repeat_c2    ss   20  8099.331 ± 33.159  ms/op

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

Commit messages:
 - 8257223: C2: Optimize RegMask::is_bound

Changes: https://git.openjdk.java.net/jdk/pull/1515/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1515&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8257223
  Stats: 67 lines in 1 file changed: 45 ins; 3 del; 19 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1515.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1515/head:pull/1515

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


More information about the hotspot-compiler-dev mailing list