mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
nir/opt_deref: Add an instruction type switch
Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6871>
This commit is contained in:
parent
769ede2de4
commit
80e6ac3341
1 changed files with 18 additions and 12 deletions
|
|
@ -1116,22 +1116,28 @@ nir_opt_deref_impl(nir_function_impl *impl)
|
|||
|
||||
nir_foreach_block(block, impl) {
|
||||
nir_foreach_instr_safe(instr, block) {
|
||||
if (instr->type != nir_instr_type_deref)
|
||||
continue;
|
||||
|
||||
b.cursor = nir_before_instr(instr);
|
||||
|
||||
nir_deref_instr *deref = nir_instr_as_deref(instr);
|
||||
switch (deref->deref_type) {
|
||||
case nir_deref_type_ptr_as_array:
|
||||
if (opt_deref_ptr_as_array(&b, deref))
|
||||
progress = true;
|
||||
break;
|
||||
switch (instr->type) {
|
||||
case nir_instr_type_deref: {
|
||||
nir_deref_instr *deref = nir_instr_as_deref(instr);
|
||||
switch (deref->deref_type) {
|
||||
case nir_deref_type_ptr_as_array:
|
||||
if (opt_deref_ptr_as_array(&b, deref))
|
||||
progress = true;
|
||||
break;
|
||||
|
||||
case nir_deref_type_cast:
|
||||
if (opt_deref_cast(&b, deref))
|
||||
progress = true;
|
||||
case nir_deref_type_cast:
|
||||
if (opt_deref_cast(&b, deref))
|
||||
progress = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
/* Do nothing */
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
/* Do nothing */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue