jay: have proper UNDEF

matches NIR's broken semantics but allows more opts later. just a rename here.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41510>
This commit is contained in:
Alyssa Rosenzweig 2026-05-11 16:02:32 -04:00 committed by Marge Bot
parent c2911dd688
commit 45d63539a6
3 changed files with 7 additions and 7 deletions

View file

@ -760,8 +760,8 @@ jay_emit_fb_write(jay_builder *b, nir_intrinsic_instr *intr)
nir_src_is_const(intr->src[2]) && nir_src_as_bool(intr->src[2]);
for (unsigned i = 0; i < nir_src_num_components(intr->src[0]); ++i) {
srcs[i] = trivial ? jay_INDETERMINATE_u32(b) :
jay_as_gpr(b, jay_extract(data, i));
srcs[i] =
trivial ? jay_UNDEF_u32(b) : jay_as_gpr(b, jay_extract(data, i));
}
jay_inst *send =
@ -2091,7 +2091,7 @@ jay_emit_instr(struct nir_to_jay_state *nj, jay_block *block, nir_instr *instr)
if (instr->type == nir_instr_type_phi) {
jay_PHI_DST(&nj->bld, jay_extract(def, c));
} else {
jay_INDETERMINATE(&nj->bld, jay_extract(def, c));
jay_UNDEF(&nj->bld, jay_extract(def, c));
}
}

View file

@ -43,9 +43,9 @@ lower(jay_builder *b, jay_inst *I)
switch (I->op) {
case JAY_OPCODE_PRELOAD:
case JAY_OPCODE_PHI_DST:
case JAY_OPCODE_INDETERMINATE:
case JAY_OPCODE_UNDEF:
/* Delete instructions that only exist for RA. Uninitialized register
* contents is a perfectly cromulent indeterminate value.
* contents is a perfectly cromulent undefined value.
*/
return true;

View file

@ -204,8 +204,8 @@ op('phi_dst', 0, 'u1 u32')
# Output from a unit test to prevent dead code elimination.
op('unit_test', 1, 'u32', Props.NO_DEST)
# Produces a stable indeterminate value. Freeze(Poison) in LLVM parlance.
op('indeterminate', 0, 'u1 u32')
# Produces a unstable indeterminate value. Undef in LLVM parlance.
op('undef', 0, 'u1 u32')
op('not', 1, 'u1 u32', Props.CMOD)
op('cast_canonical_to_flag', 1, 'u1')