RFR: 8294366: RISC-V: Partially mark out incompressible regions [v2]

Xiaolin Zheng xlinzheng at openjdk.org
Sat Oct 8 15:59:58 UTC 2022


> Shortly, the current RVC implementation in the RISC-V backend is a "whitelist mode", merely compressing instructions marked by "CompressibleRegion" that covers just part of C2 matching rules and stub code (only ~5% compression rate). Due to the originally existing large backend code base and to spread the coverage to nearly all instructions generated by the backend, we cannot modify them little by little, but should implement a "blacklist mode" (a compression rate to ~20% if complete), to exclude compressions from:
> 1. relocations
> 2. patchable instructions
> 3. fixed length code slices whose code size is calculated
> 
> Please check the discussions in the riscv-port mailing list[1] to go in for more details.
> 
> This patch contains the first half of implementations which does not change the program behavior: it just introduces an "IncompressibleRegion" to indicate a piece of code "not compressible", marking out the patchable instructions and fixed-length code slices that are not able to compress by RVC.
> 
> Besides, this patch also temporarily removes some automatic compression logic of branch instructions like "jal"s and "beq"s, for MachBranchNodes' fake labels could hamper the automatic compression as well and for making code clean. Please also check the discussions in the thread[1].
> 
> Please check the unsquashed commits to have a better review of the patch.
> 
> 
> Tested a hotspot tier1 and tier2 with the option UseRVC turning on.
> 
> [1] https://mail.openjdk.org/pipermail/riscv-port-dev/2022-September/000615.html
> 
> Thanks,
> Xiaolin

Xiaolin Zheng 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 10 additional commits since the last revision:

 - Plural form
 - comment polishment
 - patchable nop's code style
 - Merge remote-tracking branch 'github-openjdk/master' into riscv-rvc-checkin-first-half-part
 - Merge remote-tracking branch 'github-openjdk/master' into riscv-rvc-checkin-first-half-part
 - [5] RVC: IncompressibleRegions for patchable labels
 - [4] RVC: IncompressibleRegions for fixed length code slices
 - [3] RVC: IncompressibleRegions for patchable nops
 - [2] RVC: Disable auto transformations for branch instructions
 - [1] RVC: Add the IncompressibleRegion

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/10421/files
  - new: https://git.openjdk.org/jdk/pull/10421/files/692b8f86..fc3657c5

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=10421&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10421&range=00-01

  Stats: 25190 lines in 644 files changed: 15000 ins; 7871 del; 2319 mod
  Patch: https://git.openjdk.org/jdk/pull/10421.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/10421/head:pull/10421

PR: https://git.openjdk.org/jdk/pull/10421


More information about the hotspot-dev mailing list