[llvm] [SelectionDAG] Add opcode class metadata to DOT nodes (PR #228965)

Jonathan L'Work via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 7 06:46:29 PDT 2026


Jonathan03ant wrote:

> There aren't that many different target-independent opcodes that would exist in SelectionDAG. Primarily they are going to be copys, extract_subreg, insert_subreg, subreg_to_reg.

@topperc The distinction is useful to LLVMViz because it shows whether a selected machine-opcode node is target-independent compiler machinery, such as `COPY` or `EXTRACT_SUBREG`, or an instruction/pseudo selected by the target backend, such as AMDGPU’s `V_ADD_U32_e64` or `S_ENDPGM` and so on.

These are still SelectionDAG nodes in the DOT graph, not `MachineInstr` objects yet, but their opcodes belong to the machine-instruction domain and will become MIR instructions afterward.

I agree that only a small number of target-independent machine opcodes normally appear here. If LLVM prefers consumers to recognize that fixed set themselves, I can move that part into LLVMViz. My main goal is to avoid determining opcode domains from printed names.

https://github.com/llvm/llvm-project/pull/228965


More information about the llvm-commits mailing list