RFR: 8326135: Enhance adlc to report unused operands [v3]

Vladimir Kozlov kvn at openjdk.org
Wed Feb 21 16:08:54 UTC 2024


On Wed, 21 Feb 2024 08:28:16 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:
> 
>   add stackSlotP example in comments

Please update Copyright year to 2024 in changed files if needed:

< // Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
---
> // Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.

And you need second review

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

PR Comment: https://git.openjdk.org/jdk/pull/17910#issuecomment-1957115564


More information about the hotspot-compiler-dev mailing list