Lines Matching refs:instr
61 nir_instr *instr; member
111 nir_foreach_instr_safe(instr, block) { in gcm_pin_instructions_block()
112 switch (instr->type) { in gcm_pin_instructions_block()
114 switch (nir_instr_as_alu(instr)->op) { in gcm_pin_instructions_block()
122 instr->pass_flags = GCM_INSTR_PINNED; in gcm_pin_instructions_block()
126 instr->pass_flags = 0; in gcm_pin_instructions_block()
132 switch (nir_instr_as_tex(instr)->op) { in gcm_pin_instructions_block()
137 instr->pass_flags = GCM_INSTR_PINNED; in gcm_pin_instructions_block()
141 instr->pass_flags = 0; in gcm_pin_instructions_block()
147 instr->pass_flags = 0; in gcm_pin_instructions_block()
152 &nir_intrinsic_infos[nir_instr_as_intrinsic(instr)->intrinsic]; in gcm_pin_instructions_block()
156 instr->pass_flags = 0; in gcm_pin_instructions_block()
158 instr->pass_flags = GCM_INSTR_PINNED; in gcm_pin_instructions_block()
166 instr->pass_flags = GCM_INSTR_PINNED; in gcm_pin_instructions_block()
173 if (!(instr->pass_flags & GCM_INSTR_PINNED)) { in gcm_pin_instructions_block()
185 exec_node_remove(&instr->node); in gcm_pin_instructions_block()
186 exec_list_push_tail(&state->instrs, &instr->node); in gcm_pin_instructions_block()
194 gcm_schedule_early_instr(nir_instr *instr, struct gcm_state *state);
207 nir_instr *instr = state->instr; in gcm_schedule_early_src() local
220 if (instr->block->index < src->ssa->parent_instr->block->index) in gcm_schedule_early_src()
221 instr->block = src->ssa->parent_instr->block; in gcm_schedule_early_src()
228 state->instr = instr; in gcm_schedule_early_src()
241 gcm_schedule_early_instr(nir_instr *instr, struct gcm_state *state) in gcm_schedule_early_instr() argument
243 if (instr->pass_flags & GCM_INSTR_SCHEDULED_EARLY) in gcm_schedule_early_instr()
246 instr->pass_flags |= GCM_INSTR_SCHEDULED_EARLY; in gcm_schedule_early_instr()
252 if (instr->pass_flags & GCM_INSTR_PINNED) in gcm_schedule_early_instr()
258 instr->block = nir_start_block(state->impl); in gcm_schedule_early_instr()
259 state->instr = instr; in gcm_schedule_early_instr()
261 nir_foreach_src(instr, gcm_schedule_early_src, state); in gcm_schedule_early_instr()
265 gcm_schedule_late_instr(nir_instr *instr, struct gcm_state *state);
356 gcm_schedule_late_instr(nir_instr *instr, struct gcm_state *state) in gcm_schedule_late_instr() argument
358 if (instr->pass_flags & GCM_INSTR_SCHEDULED_LATE) in gcm_schedule_late_instr()
361 instr->pass_flags |= GCM_INSTR_SCHEDULED_LATE; in gcm_schedule_late_instr()
367 if (instr->pass_flags & GCM_INSTR_PINNED) in gcm_schedule_late_instr()
370 nir_foreach_ssa_def(instr, gcm_schedule_late_def, state); in gcm_schedule_late_instr()
374 gcm_place_instr(nir_instr *instr, struct gcm_state *state);
401 gcm_place_instr(nir_instr *instr, struct gcm_state *state) in gcm_place_instr() argument
403 if (instr->pass_flags & GCM_INSTR_PLACED) in gcm_place_instr()
406 instr->pass_flags |= GCM_INSTR_PLACED; in gcm_place_instr()
412 if (instr->type == nir_instr_type_phi) { in gcm_place_instr()
413 assert(instr->pass_flags & GCM_INSTR_PINNED); in gcm_place_instr()
417 nir_foreach_ssa_def(instr, gcm_place_instr_def, state); in gcm_place_instr()
419 if (instr->pass_flags & GCM_INSTR_PINNED) { in gcm_place_instr()
425 for (nir_instr *after = nir_instr_next(instr); in gcm_place_instr()
435 struct gcm_block_info *block_info = &state->blocks[instr->block->index]; in gcm_place_instr()
436 if (!(instr->pass_flags & GCM_INSTR_PINNED)) { in gcm_place_instr()
437 exec_node_remove(&instr->node); in gcm_place_instr()
441 &instr->node); in gcm_place_instr()
444 nir_instr *jump_instr = nir_block_last_instr(instr->block); in gcm_place_instr()
446 exec_node_insert_node_before(&jump_instr->node, &instr->node); in gcm_place_instr()
448 exec_list_push_tail(&instr->block->instr_list, &instr->node); in gcm_place_instr()
453 block_info->last_instr = instr; in gcm_place_instr()
465 state.instr = NULL; in opt_gcm_impl()
478 foreach_list_typed_safe(nir_instr, instr, node, &state.instrs) { in opt_gcm_impl()
479 if (nir_instr_set_add_or_rewrite(gvn_set, instr)) { in opt_gcm_impl()
480 nir_instr_remove(instr); in opt_gcm_impl()
487 foreach_list_typed(nir_instr, instr, node, &state.instrs) in opt_gcm_impl()
488 gcm_schedule_early_instr(instr, &state); in opt_gcm_impl()
490 foreach_list_typed(nir_instr, instr, node, &state.instrs) in opt_gcm_impl()
491 gcm_schedule_late_instr(instr, &state); in opt_gcm_impl()
494 nir_instr *instr = exec_node_data(nir_instr, in opt_gcm_impl() local
496 gcm_place_instr(instr, &state); in opt_gcm_impl()