openjdk/jdk · warning
Warning: unused operand (%s)
Error message
Warning: unused operand (%s)
What it means
ADLC lint warning from ArchDesc's operand-usage check: an operand form is defined in the .ad file but never referenced by any instruction, encoding, or the built-in form-callback sweep (which pre-marks legacy vector forms like legVecS/D/X/Y/Z under #ifdef). Printed as '\nWarning: unused operand (<ident>)'; the build still succeeds.
Source
Thrown at src/hotspot/share/adlc/archDesc.cpp:776
#elif defined(AMD64)
callback.do_form_by_name("vecS");
callback.do_form_by_name("vecD");
callback.do_form_by_name("vecX");
callback.do_form_by_name("vecY");
callback.do_form_by_name("vecZ");
callback.do_form_by_name("legVecS");
callback.do_form_by_name("legVecD");
callback.do_form_by_name("legVecX");
callback.do_form_by_name("legVecY");
callback.do_form_by_name("legVecZ");
#endif
int cnt = 0;
_operands.reset();
OperandForm* operand;
for ( ; (operand = (OperandForm*)_operands.iter()) != nullptr; ) {
if(visited.find(operand) == visited.end() && !operand->ideal_only()) {
fprintf(stderr, "\nWarning: unused operand (%s)", operand->_ident);
cnt++;
}
}
if (cnt) fprintf(stderr, "\n-------Warning: total %d unused operands\n", cnt);
return true;
}
void ArchDesc::dump() {
_pre_header.dump();
_header.dump();
_source.dump();
if (_register) _register->dump();
fprintf(stderr,"\n");
fprintf(stderr,"------------------ Dump Operands ---------------------\n");
_operands.dump();
fprintf(stderr,"\n");
fprintf(stderr,"------------------ Dump Operand Classes --------------\n");View on GitHub (pinned to 88dfb74bbe)
Solutions
- Remove the operand definition if it is truly dead
- Or reference it from the intended instruction/encode you were about to add
- Ignore for upstream-controlled files where the warning is pre-existing
Defensive patterns
Strategy: validation
Validate before calling
make adlc 2>&1 | grep -oP '(?<=Warning: unused operand \()[^)]+' # list operands to wire up or delete
Prevention
- Delete operands when removing the last instruction using them
- Reference new operands from at least one match rule or encode
- Track unused-operand warnings in CI diffs
When it happens
Trigger: Defining an operand (e.g. for a planned instruction) but never using it in any match rule/encode; deleting the instructions that used an operand while leaving the definition.
Common situations: Ports and experiments on cpu .ad files; upstream refactors that dropped instructions but kept operands; expected noise when a platform intentionally keeps spare operands.
Related errors
- -------Warning: total %d unused operands
- %s: Found %d warning
- Error: Out of memory in ADLC\n
- %s: Found %d syntax error
- %s: Found %d semantic error
AI-assisted analysis of openjdk/jdk@88dfb74bbe (2026-08-14).
Data as JSON: /api/errors/0ad6332761f6e22a.
Report an issue: GitHub.