RFR: 8326135: Enhance adlc to report unused operands [v5]
Vladimir Ivanov
vlivanov at openjdk.org
Wed Feb 28 03:25:55 UTC 2024
On Thu, 22 Feb 2024 08:28:20 GMT, kuaiwei <duke at openjdk.org> wrote:
>> Some operands are defined in adfile but no one used them. But it's hard to find them manually. So I try to enhance adlc to report them after parsing the whole adfile.
>>
>> I added a helper Form::forms_do to recursively visit child forms. After parsing, adlc will start from all instructions to mark all used forms. And report unvisited operands as unused. By this way, I can find 44 unused operands for aarch64, 12 for x86_64 and 4 for riscv64. The report is like
>>
>> ...
>> Warning: unused operand (vRegD_V28)
>> Warning: unused operand (vRegD_V29)
>> Warning: unused operand (vRegD_V30)
>> Warning: unused operand (vRegD_V31)
>> Warning: unused operand (lr_RegP)
>> Warning: unused operand (indOffI)
>> Warning: unused operand (indOffL)
>> Warning: unused operand (thread_anchor_pc)
>> -------Warning: total 44 unused operands
>>
>>
>> I tested and find they can be safely removed.
>
> kuaiwei has updated the pull request incrementally with one additional commit since the last revision:
>
> Fix false alert for ARM architecture
Marked as reviewed by vlivanov (Reviewer).
-------------
PR Review: https://git.openjdk.org/jdk/pull/17910#pullrequestreview-1905234513
More information about the hotspot-compiler-dev
mailing list