Integrated: 8305787: Wrong debugging information printed with TraceOptoOutput
Jasmine Karthikeyan
jkarthikeyan at openjdk.org
Thu May 18 15:13:06 UTC 2023
On Mon, 10 Apr 2023 03:43:17 GMT, Jasmine Karthikeyan <jkarthikeyan at openjdk.org> wrote:
> 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!
This pull request has now been integrated.
Changeset: cc5c9b5d
Author: Jasmine Karthikeyan <jkarthikeyan at openjdk.org>
Committer: Vladimir Kozlov <kvn at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/cc5c9b5da2de4229c0244169bcbd6496f68db5ab
Stats: 76 lines in 3 files changed: 37 ins; 2 del; 37 mod
8305787: Wrong debugging information printed with TraceOptoOutput
Reviewed-by: thartmann, kvn
-------------
PR: https://git.openjdk.org/jdk/pull/13403
More information about the hotspot-compiler-dev
mailing list