nir: make nir_instr_clone usable with load_const and undef

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31031>
This commit is contained in:
Georg Lehmann 2024-09-04 18:33:20 +02:00 committed by Marge Bot
parent a9f8089240
commit 40fc85c15b

View file

@ -325,7 +325,8 @@ clone_load_const(clone_state *state, const nir_load_const_instr *lc)
memcpy(&nlc->value, &lc->value, sizeof(*nlc->value) * lc->def.num_components);
add_remap(state, &nlc->def, &lc->def);
if (likely(state->remap_table))
add_remap(state, &nlc->def, &lc->def);
return nlc;
}
@ -337,7 +338,8 @@ clone_ssa_undef(clone_state *state, const nir_undef_instr *sa)
nir_undef_instr_create(state->ns, sa->def.num_components,
sa->def.bit_size);
add_remap(state, &nsa->def, &sa->def);
if (likely(state->remap_table))
add_remap(state, &nsa->def, &sa->def);
return nsa;
}