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

kuaiwei duke at openjdk.org
Thu Feb 22 08:28:20 UTC 2024


> 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

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/17910/files
  - new: https://git.openjdk.org/jdk/pull/17910/files/a01236f4..6d8acb2a

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=17910&range=04
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17910&range=03-04

  Stats: 8 lines in 1 file changed: 8 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/17910.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17910/head:pull/17910

PR: https://git.openjdk.org/jdk/pull/17910


More information about the hotspot-compiler-dev mailing list