Skip to content

Add ConstKind::Undef (i.e. SPIR-V OpUndef).#37

Draft
eddyb wants to merge 1 commit intoeddyb/output-hermetic-loopsfrom
eddyb/undef
Draft

Add ConstKind::Undef (i.e. SPIR-V OpUndef).#37
eddyb wants to merge 1 commit intoeddyb/output-hermetic-loopsfrom
eddyb/undef

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, up to and including this PR (whose branch is the "base" of this one):


This would be a a pretty simple addition: a SPIR-T "native" equivalent of SPIR-V OpUndef / LLVM undef, mainly simplifying the creation of "filler" constants for dynamically-unused dataflow outputs etc.


Except that SPIR-V is moving towards "poison" (including a brand new extension, SPV_KHR_poison_freeze), following in the footsteps of LLVM - see also:

One of the places where AFAICT they're willing to be more aggressive than LLVM, is "uninitialized memory" - OpVariable seems to now default to a poison initializer, not undef.

It's not unclear at this moment how much of undef+poison should be modeled in SPIR-T, but some could help.

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