RFR: 8305787: Wrong debugging information printed with TraceOptoOutput [v3]
Jasmine Karthikeyan
jkarthikeyan at openjdk.org
Thu May 18 05:36:07 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!
Jasmine Karthikeyan has updated the pull request incrementally with one additional commit since the last revision:
Fix copyright
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/13403/files
- new: https://git.openjdk.org/jdk/pull/13403/files/79e3f744..c875474d
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=13403&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=13403&range=01-02
Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 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