mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 18:18:06 +02:00
pan/bi: Update ins->link after scheduling
Otherwise foreach_instr and friends will be subtly wrong. None of our current passes rely on this but it's a footgun. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10961>
This commit is contained in:
parent
522020e6ea
commit
0515c6a3fb
1 changed files with 15 additions and 0 deletions
|
|
@ -1565,6 +1565,21 @@ bi_schedule_block(bi_context *ctx, bi_block *block)
|
|||
last_clause->flow_control = BIFROST_FLOW_NBTB_UNCONDITIONAL;
|
||||
}
|
||||
|
||||
/* Reorder instructions to match the new schedule. First remove
|
||||
* existing instructions and then recreate the list */
|
||||
|
||||
bi_foreach_instr_in_block_safe(block, ins) {
|
||||
list_del(&ins->link);
|
||||
}
|
||||
|
||||
bi_foreach_clause_in_block(block, clause) {
|
||||
for (unsigned i = 0; i < clause->tuple_count; ++i) {
|
||||
bi_foreach_instr_in_tuple(&clause->tuples[i], ins) {
|
||||
list_addtail(&ins->link, &block->base.instructions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
block->scheduled = true;
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue