}
static bool
-pass(struct nir_builder *b, nir_instr *instr, UNUSED void *data)
+pass(struct nir_builder *b, nir_intrinsic_instr *intr, void *data)
{
- if (instr->type != nir_instr_type_intrinsic)
- return false;
-
- nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr);
if (intr->intrinsic != nir_intrinsic_load_global &&
intr->intrinsic != nir_intrinsic_load_global_constant &&
intr->intrinsic != nir_intrinsic_global_atomic &&
intr->intrinsic != nir_intrinsic_store_global)
return false;
- b->cursor = nir_before_instr(instr);
+ b->cursor = nir_before_instr(&intr->instr);
unsigned bitsize = intr->intrinsic == nir_intrinsic_store_global
? nir_src_bit_size(intr->src[0])
if (repl)
nir_def_rewrite_uses(&intr->def, repl);
- nir_instr_remove(instr);
+ nir_instr_remove(&intr->instr);
return true;
}
bool
agx_nir_lower_address(nir_shader *shader)
{
- return nir_shader_instructions_pass(
+ return nir_shader_intrinsics_pass(
shader, pass, nir_metadata_block_index | nir_metadata_dominance, NULL);
}