RFR: 8305787: Wrong debugging information printed with TraceOptoOutput [v2]
Tobias Hartmann
thartmann at openjdk.org
Wed May 17 11:15:46 UTC 2023
On Tue, 11 Apr 2023 17:41:32 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!
>
> Jasmine Karthikeyan has updated the pull request incrementally with one additional commit since the last revision:
>
> Update copyright years
Looks reasonable to me but I'm not an expert in this code. Another review would be good.
-------------
Marked as reviewed by thartmann (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/13403#pullrequestreview-1430402365
More information about the hotspot-compiler-dev
mailing list