RFR: 8305787: Wrong debugging information printed with TraceOptoOutput

Jasmine Karthikeyan jkarthikeyan at openjdk.org
Mon Apr 10 03:49:41 UTC 2023


This patch fixes a minor bug in aldc where the wrong resource names are printed when the flag TraceOptoOutput is enabled to debug instruction scheduling.
As an example, the output:

*** Bundle: 1 instr, resources: D0 BR
 126 salI_rReg_imm === _ 240 |271 [[ 127 125 ]] #5/0x00000005

states that the bundle is using resources D0 and BR, but the second resource used is actually ALU0.

The issue is caused because `pipeline->_rescount` is only incremented for discrete resources [(here)](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/adlc/adlparse.cpp#L1612), resources specified without `=`. However, the list of names is added to for *all* resources [(here)](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/adlc/adlparse.cpp#L1652), so using `_rescount` to index the names causes it to go out of sync. The fix is found in [output_h.cpp](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/adlc/output_h.cpp#L2231), where it uses the iterator to go through all the resources and use only the ones that are discrete. I applied that fix to this case, and also fixed the other instances of this bug. Reviews on this fix would be appreciated!

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

Commit messages:
 - Ensure correct pipeline resources are used in adlc

Changes: https://git.openjdk.org/jdk/pull/13403/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=13403&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8305787
  Stats: 73 lines in 3 files changed: 37 ins; 2 del; 34 mod
  Patch: https://git.openjdk.org/jdk/pull/13403.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13403/head:pull/13403

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


More information about the hotspot-compiler-dev mailing list