pan/bi: Remove bogus assert lowering branches

We can get BRANCHZ.i16 since we lower JUMP early. This seems to have worked
before mainly by chance. With the change to how we optimize, we can get code
sequences like:

   block2 {
      BRANCHZ.i16.eq u256, u256 -> block5
      BRANCHZ.i16.eq u256, u256 -> block4
   } -> block5  from block1

which would choke the assert.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17794>
This commit is contained in:
Alyssa Rosenzweig 2022-07-25 12:06:40 -04:00 committed by Marge Bot
parent a01e6b6dc7
commit 49e8f660f5

View file

@ -4727,19 +4727,16 @@ bi_lower_branch(bi_context *ctx, bi_block *block)
{
bool cull_terminal = (ctx->arch <= 8);
bool branched = false;
ASSERTED bool was_jump = false;
bi_foreach_instr_in_block_safe(block, ins) {
if (!ins->branch_target) continue;
if (branched) {
assert(was_jump && (ins->op == BI_OPCODE_JUMP));
bi_remove_instruction(ins);
continue;
}
branched = true;
was_jump = ins->op == BI_OPCODE_JUMP;
if (!bi_is_terminal_block(ins->branch_target))
continue;