RFR: 8331295: C2: High memory usage reported in PhaseChaitin::Split

Daniel Lundén dlunden at openjdk.org
Fri Nov 15 18:36:16 UTC 2024


On aarch64, the C2 instruction matcher often clones addressing expressions, expecting them to be subsumed (during later stages of matching) into complex load/store instructions. However, volatile aarch64 load and store instructions have indirect memory inputs and therefore cannot subsume the addressing computation. In one case that we investigated, the result is a very large number of cloned identical instructions for address computations that, in combination with how the instruction scheduler currently hoists instructions, create major difficulties for the register allocator.

### Changeset

- Add a guard that ensures the instruction matcher does not clone addressing expressions that have at least one successor load/store that cannot subsume the addressing computation. One could argue that, in cases where there is at least one such successor, other successors may be able to subsume the computation and we should therefore still clone the expression. The benefit of subsuming in such a case is unclear, however, as we in any case need to generate at least one separate instruction for the addressing computation.
- Remove temporary `-XX:CompileCommand=memlimit,...,0` for tests that previously failed.
- Add a new IR framework regression test.

### Testing

- [GitHub Actions](https://github.com/dlunde/jdk/actions/runs/11859255022)
- `tier1` to `tier4` (and additional Oracle-internal testing) on Windows x64, Linux x64, Linux aarch64, macOS x64, and macOS aarch64.
- Performance benchmarks: DaCapo, SPECjbb, and SPECjvm on Windows x64, Linux x64, Linux aarch64, macOS x64, and macOS aarch64. No clear regressions.

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

Commit messages:
 - Initial fix

Changes: https://git.openjdk.org/jdk/pull/22157/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22157&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8331295
  Stats: 252 lines in 4 files changed: 249 ins; 1 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/22157.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22157/head:pull/22157

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


More information about the hotspot-compiler-dev mailing list