Skip to content

Unify DataInst and Node (removing NodeKind::Block in the process).#33

Draft
eddyb wants to merge 6 commits intoeddyb/post-rust-gpu-0.10from
eddyb/insts-are-nodes
Draft

Unify DataInst and Node (removing NodeKind::Block in the process).#33
eddyb wants to merge 6 commits intoeddyb/post-rust-gpu-0.10from
eddyb/insts-are-nodes

Conversation

@eddyb
Copy link
Copy Markdown
Member

@eddyb eddyb commented Apr 22, 2026

Note: this PR is a draft to avoid accidental merging onto its "base" branch (used as a form of ad-hoc PR stacking), and will remain as such, until its "base" branch can be set to main, i.e. all prerequisite PRs will have landed.


This PR removes the distinction between DataInst and Node (formerly ControlNode), and the NodeKind::Block container for DataInst (flattening them into the parent Region of the "block" Node, instead).

The distinction was purely artificial, and mainly guided by remaining close to SPIR-V wherever possible, but SPIR-V blocks are already regenerated (in spv::lift) from sequences of instructions chained by linear control-flow, so there is no significant benefit to keeping the DataInst split (or their "block" containers).

Keeping only "regions" and "nodes" also aligns better with RVSDG (where SPIR-T gets those concepts from).


TODO: finish node-vs-node-output attribute handling, remove the DataInst/DataInstDef/DataInstKind aliases from these commits and future ones (along with the naming style of inst, however convenient it may have been).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant