mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 04:30:10 +01:00
nir/lower_reg: Remove dead reg_decl intrinsics
For any reg we can lower, we remove it whenever we remove the last read or write. For regs that aren't used at all, however, there are no reads or writes so there's nothing to trigger the removal. Instead, we need to do it in setup_reg. Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28300>
This commit is contained in:
parent
7576212c2c
commit
bef0601d51
1 changed files with 5 additions and 0 deletions
|
|
@ -36,6 +36,11 @@ struct regs_to_ssa_state {
|
|||
static void
|
||||
setup_reg(nir_intrinsic_instr *decl, struct regs_to_ssa_state *state)
|
||||
{
|
||||
if (nir_def_is_unused(&decl->def)) {
|
||||
nir_instr_remove(&decl->instr);
|
||||
return;
|
||||
}
|
||||
|
||||
assert(state->values[decl->def.index] == NULL);
|
||||
if (!should_lower_reg(decl))
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue