mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 16:40:13 +01:00
agx: Optimize logical_end removal
We know logical_end instructions are only at the end of the block (validated), so by changing how we iterate the pass goes from O(instructions) to O(blocks) which is strictly better. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
This commit is contained in:
parent
d459de85b7
commit
135f3c35c5
1 changed files with 7 additions and 3 deletions
|
|
@ -984,9 +984,13 @@ agx_pack_binary(agx_context *ctx, struct util_dynarray *emission)
|
|||
struct util_dynarray fixups;
|
||||
util_dynarray_init(&fixups, ctx);
|
||||
|
||||
agx_foreach_instr_global_safe(ctx, I) {
|
||||
if (I->op == AGX_OPCODE_LOGICAL_END)
|
||||
agx_remove_instruction(I);
|
||||
agx_foreach_block(ctx, block) {
|
||||
agx_foreach_instr_in_block_rev(block, I) {
|
||||
if (I->op == AGX_OPCODE_LOGICAL_END) {
|
||||
agx_remove_instruction(I);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
agx_foreach_block(ctx, block) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue