mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
lima/ppir: merge branch nodes in simple cases
In some simple cases, we can merge the branch operation with an existing instruction and avoid the creation of an empty new instruction just for the branch node. Signed-off-by: Erico Nunes <nunes.erico@gmail.com> Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16163>
This commit is contained in:
parent
c3f13ee551
commit
106dc60fc0
1 changed files with 12 additions and 0 deletions
|
|
@ -58,6 +58,18 @@ static bool ppir_do_node_to_instr_try_insert(ppir_block *block, ppir_node *node)
|
|||
return ppir_instr_insert_node(succ->instr, node);
|
||||
}
|
||||
|
||||
if (ppir_node_has_single_succ(node) &&
|
||||
ppir_node_has_single_pred(ppir_node_first_succ(node)) &&
|
||||
(ppir_node_first_succ(node)->type == ppir_node_type_branch)) {
|
||||
|
||||
assert(ppir_node_has_single_succ(node));
|
||||
ppir_node *succ = ppir_node_first_succ(node);
|
||||
assert(succ);
|
||||
assert(succ->instr);
|
||||
|
||||
return ppir_instr_insert_node(succ->instr, node);
|
||||
}
|
||||
|
||||
switch (node->type) {
|
||||
case ppir_node_type_load:
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue