nir/print: print io instr->name if available

this will always be more accurate than trying to find the name from
a variable

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28814>
This commit is contained in:
Mike Blumenkrantz 2024-04-18 10:55:37 -04:00 committed by Marge Bot
parent 948126368a
commit cb597cb85e
1 changed files with 5 additions and 0 deletions

View File

@ -1631,6 +1631,11 @@ print_intrinsic_instr(nir_intrinsic_instr *instr, print_state *state)
return;
}
if (instr->name) {
fprintf(fp, " // %s", instr->name);
return;
}
nir_foreach_variable_with_modes(var, state->shader, var_mode) {
if (!var->name)
continue;