mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 21:10:12 +01:00
nv50/ir: deal with loops with no breaks
For example if there are only returns, the break bb will not end up part of the CFG. However there will have been a prebreak already emitted for it, and when hitting the RET that comes after, we will try to insert the current (i.e. break) BB into the graph even though it will be unreachable. This makes the SSA code sad. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "11.0 11.1" <mesa-stable@lists.freedesktop.org>
This commit is contained in:
parent
ff61ac4838
commit
adcc547bfb
1 changed files with 6 additions and 0 deletions
|
|
@ -2893,6 +2893,12 @@ Converter::handleInstruction(const struct tgsi_full_instruction *insn)
|
|||
bb->cfg.attach(&loopBB->cfg, Graph::Edge::BACK);
|
||||
}
|
||||
setPosition(reinterpret_cast<BasicBlock *>(breakBBs.pop().u.p), true);
|
||||
|
||||
// If the loop never breaks (e.g. only has RET's inside), then there
|
||||
// will be no way to get to the break bb. However BGNLOOP will have
|
||||
// already made a PREBREAK to it, so it must be in the CFG.
|
||||
if (getBB()->cfg.incidentCount() == 0)
|
||||
loopBB->cfg.attach(&getBB()->cfg, Graph::Edge::TREE);
|
||||
}
|
||||
break;
|
||||
case TGSI_OPCODE_BRK:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue