{"record":{"id":"0ad6332761f6e22a","repo":"openjdk/jdk","slug":"warning-unused-operand-s","errorCode":null,"errorMessage":"\nWarning: unused operand (%s)","messagePattern":"\nWarning: unused operand \\((.+?)\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/hotspot/share/adlc/archDesc.cpp","lineNumber":776,"sourceCode":"#elif defined(AMD64)\n  callback.do_form_by_name(\"vecS\");\n  callback.do_form_by_name(\"vecD\");\n  callback.do_form_by_name(\"vecX\");\n  callback.do_form_by_name(\"vecY\");\n  callback.do_form_by_name(\"vecZ\");\n  callback.do_form_by_name(\"legVecS\");\n  callback.do_form_by_name(\"legVecD\");\n  callback.do_form_by_name(\"legVecX\");\n  callback.do_form_by_name(\"legVecY\");\n  callback.do_form_by_name(\"legVecZ\");\n#endif\n\n  int cnt = 0;\n  _operands.reset();\n  OperandForm* operand;\n  for ( ; (operand = (OperandForm*)_operands.iter()) != nullptr; ) {\n    if(visited.find(operand) == visited.end() && !operand->ideal_only()) {\n      fprintf(stderr, \"\\nWarning: unused operand (%s)\", operand->_ident);\n      cnt++;\n    }\n  }\n  if (cnt) fprintf(stderr, \"\\n-------Warning: total %d unused operands\\n\", cnt);\n\n  return true;\n}\n\nvoid ArchDesc::dump() {\n  _pre_header.dump();\n  _header.dump();\n  _source.dump();\n  if (_register) _register->dump();\n  fprintf(stderr,\"\\n\");\n  fprintf(stderr,\"------------------ Dump Operands ---------------------\\n\");\n  _operands.dump();\n  fprintf(stderr,\"\\n\");\n  fprintf(stderr,\"------------------ Dump Operand Classes --------------\\n\");","sourceCodeStart":758,"sourceCodeEnd":794,"githubUrl":"https://github.com/openjdk/jdk/blob/88dfb74bbeefcf2b0aa11835183bcd949998fc8f/src/hotspot/share/adlc/archDesc.cpp#L758-L794","documentation":"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.","triggerScenarios":"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.","commonSituations":"Ports and experiments on cpu .ad files; upstream refactors that dropped instructions but kept operands; expected noise when a platform intentionally keeps spare operands.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"make adlc 2>&1 | grep -oP '(?<=Warning: unused operand \\()[^)]+' # list operands to wire up or delete","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["adlc","unused-operand","warnings","build","hotspot"],"backgroundTag":null,"analyzedSha":"88dfb74bbeefcf2b0aa11835183bcd949998fc8f","analyzedAt":"2026-08-14T11:45:09.665Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}