mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 15:10:10 +01:00
pco: skip over empty blocks when iterating instructions
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com> Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
This commit is contained in:
parent
effd4d3a1a
commit
358d741b22
1 changed files with 10 additions and 0 deletions
|
|
@ -1269,6 +1269,11 @@ static inline pco_instr *pco_next_instr(pco_instr *instr)
|
|||
return next_instr;
|
||||
|
||||
pco_block *block = pco_next_block(instr->parent_block);
|
||||
|
||||
/* Skip over empty blocks. */
|
||||
while (block && exec_list_is_empty(&block->instrs))
|
||||
block = pco_next_block(block);
|
||||
|
||||
return !block ? NULL : pco_first_instr(block);
|
||||
}
|
||||
|
||||
|
|
@ -1289,6 +1294,11 @@ static inline pco_instr *pco_prev_instr(pco_instr *instr)
|
|||
return prev_instr;
|
||||
|
||||
pco_block *block = pco_prev_block(instr->parent_block);
|
||||
|
||||
/* Skip over empty blocks. */
|
||||
while (block && exec_list_is_empty(&block->instrs))
|
||||
block = pco_prev_block(block);
|
||||
|
||||
return !block ? NULL : pco_last_instr(block);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue