diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c index b5e8c3f69e3..277fe5fad96 100644 --- a/src/asahi/compiler/agx_compile.c +++ b/src/asahi/compiler/agx_compile.c @@ -1533,6 +1533,16 @@ agx_emit_phis_deferred(agx_context *ctx) } } +static void +agx_emit_undef(agx_builder *b, nir_ssa_undef_instr *instr) +{ + /* For now, just lower undefs to zero. This doesn't matter too much, since + * the lowering happens in NIR and this just allows for late lowering passes + * to result in undefs. + */ + agx_mov_imm_to(b, agx_nir_ssa_index(&instr->def), 0); +} + static void agx_emit_instr(agx_builder *b, struct nir_instr *instr) { @@ -1561,6 +1571,10 @@ agx_emit_instr(agx_builder *b, struct nir_instr *instr) agx_emit_phi(b, nir_instr_as_phi(instr)); break; + case nir_instr_type_ssa_undef: + agx_emit_undef(b, nir_instr_as_ssa_undef(instr)); + break; + default: unreachable("should've been lowered"); }