aco: Pop branch operands when targets are same in SSA elimination.

The branch instruction is no longer conditional when the targets are the
same, so the operand is not necessary and can be removed.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21493>
This commit is contained in:
Timur Kristóf 2023-04-03 00:05:09 +02:00 committed by Marge Bot
parent 739bd03c37
commit 0eb7c49c7f

View file

@ -270,8 +270,12 @@ try_remove_simple_block(ssa_elimination_ctx& ctx, Block* block)
assert(false);
}
if (branch.target[0] == branch.target[1])
if (branch.target[0] == branch.target[1]) {
while (branch.operands.size())
branch.operands.pop_back();
branch.opcode = aco_opcode::p_branch;
}
for (unsigned i = 0; i < pred.linear_succs.size(); i++)
if (pred.linear_succs[i] == block->index)