pan/bi: Use bi_worklist in analyze_helper_requirements
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16279>
This commit is contained in:
parent
89db718936
commit
44f2715777
|
@ -231,33 +231,23 @@ bi_analyze_helper_requirements(bi_context *ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Propagate that up */
|
/* Propagate that up */
|
||||||
|
u_worklist worklist;
|
||||||
|
bi_worklist_init(ctx, &worklist);
|
||||||
|
|
||||||
struct set *work_list = _mesa_set_create(NULL,
|
bi_foreach_block(ctx, block) {
|
||||||
_mesa_hash_pointer,
|
bi_worklist_push_tail(&worklist, block);
|
||||||
_mesa_key_pointer_equal);
|
}
|
||||||
|
|
||||||
struct set *visited = _mesa_set_create(NULL,
|
while (!u_worklist_is_empty(&worklist)) {
|
||||||
_mesa_hash_pointer,
|
bi_block *blk = bi_worklist_pop_tail(&worklist);
|
||||||
_mesa_key_pointer_equal);
|
|
||||||
|
|
||||||
struct set_entry *cur = _mesa_set_add(work_list, pan_exit_block(&ctx->blocks));
|
if (bi_helper_block_update(deps, blk)) {
|
||||||
|
|
||||||
do {
|
|
||||||
bi_block *blk = (struct bi_block *) cur->key;
|
|
||||||
_mesa_set_remove(work_list, cur);
|
|
||||||
|
|
||||||
bool progress = bi_helper_block_update(deps, blk);
|
|
||||||
|
|
||||||
if (progress || !_mesa_set_search(visited, blk)) {
|
|
||||||
bi_foreach_predecessor(blk, pred)
|
bi_foreach_predecessor(blk, pred)
|
||||||
_mesa_set_add(work_list, pred);
|
bi_worklist_push_head(&worklist, pred);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_mesa_set_add(visited, blk);
|
u_worklist_fini(&worklist);
|
||||||
} while((cur = _mesa_set_next_entry(work_list, NULL)) != NULL);
|
|
||||||
|
|
||||||
_mesa_set_destroy(visited, NULL);
|
|
||||||
_mesa_set_destroy(work_list, NULL);
|
|
||||||
|
|
||||||
/* Set the execute bits */
|
/* Set the execute bits */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue