mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
nir/cursor: Add a constructor for the end of a block but before the jump
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
3e9df0e3af
commit
f5e08ab6b1
2 changed files with 12 additions and 6 deletions
|
|
@ -1607,6 +1607,17 @@ nir_after_instr(nir_instr *instr)
|
|||
return cursor;
|
||||
}
|
||||
|
||||
static inline nir_cursor
|
||||
nir_after_block_before_jump(nir_block *block)
|
||||
{
|
||||
nir_instr *last_instr = nir_block_last_instr(block);
|
||||
if (last_instr && last_instr->type == nir_instr_type_jump) {
|
||||
return nir_before_instr(last_instr);
|
||||
} else {
|
||||
return nir_after_block(block);
|
||||
}
|
||||
}
|
||||
|
||||
static inline nir_cursor
|
||||
nir_before_cf_node(nir_cf_node *node)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -249,12 +249,7 @@ add_parallel_copy_to_end_of_block(nir_block *block, void *void_state)
|
|||
nir_parallel_copy_instr *pcopy =
|
||||
nir_parallel_copy_instr_create(state->dead_ctx);
|
||||
|
||||
nir_instr *last_instr = nir_block_last_instr(block);
|
||||
if (last_instr && last_instr->type == nir_instr_type_jump) {
|
||||
nir_instr_insert_before(last_instr, &pcopy->instr);
|
||||
} else {
|
||||
nir_instr_insert_after_block(block, &pcopy->instr);
|
||||
}
|
||||
nir_instr_insert(nir_after_block_before_jump(block), &pcopy->instr);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue