mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-25 15:40:46 +02:00
broadcom/compiler: check instruction belongs to current block
Check in the ldunif optimization if the current instruction belongs to current block. These avoids again searching the instruction when current block is not correctly set, as it happened in https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12339 and in https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12221. v2: - Remove extra blank line (Iago) Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12358>
This commit is contained in:
parent
3ef2ca9cbf
commit
265515fa62
1 changed files with 15 additions and 0 deletions
|
|
@ -1869,6 +1869,21 @@ try_opt_ldunif(struct v3d_compile *c, uint32_t index, struct qreg *unif)
|
|||
{
|
||||
uint32_t count = 20;
|
||||
struct qinst *prev_inst = NULL;
|
||||
assert(c->cur_block);
|
||||
|
||||
#ifdef DEBUG
|
||||
/* Check if the current instruction is part of the current block */
|
||||
bool found = false;
|
||||
vir_for_each_inst(inst, c->cur_block) {
|
||||
if (&inst->link == c->cursor.link) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
assert(found || list_is_empty(&c->cur_block->instructions));
|
||||
#endif
|
||||
|
||||
list_for_each_entry_from_rev(struct qinst, inst, c->cursor.link->prev,
|
||||
&c->cur_block->instructions, link) {
|
||||
if ((inst->qpu.sig.ldunif || inst->qpu.sig.ldunifrf) &&
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue