summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/lima/ir/pp/node_to_instr.c
diff options
context:
space:
mode:
authorVasily Khoruzhick <anarsoul@gmail.com>2021-11-16 20:24:25 -0800
committerMarge Bot <emma+marge@anholt.net>2021-11-24 02:26:08 +0000
commit98a7c4c6f8e0dd8aca665ff1ae475ab3cdd53b12 (patch)
treea73348bdd69e691813f6504f8a631ce0a3e3bb5b /src/gallium/drivers/lima/ir/pp/node_to_instr.c
parent64292c0f05ba891d9c7319e1a1cea98eb0630af4 (diff)
downloadmesa-98a7c4c6f8e0dd8aca665ff1ae475ab3cdd53b12.tar.gz
lima/ppir: check if mul node is a source of add node before inserting
We can't insert mul node into add node instruction if it's a virtual dep (sequence or write_or_read dep), so use ppir_node_has_single_src_succ in addition to ppir_node_has_single_succ. We can't use ppir_node_has_single_src_succ alone, since node may have a virtual dependency in addition to source dependency, and we can't insert it either in this case. Reviewed-by: Andreas Baierl <ichgeh@imkreisrum.de> Reviewed-by: Erico Nunes <nunes.erico@gmail.com> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13830>
Diffstat (limited to 'src/gallium/drivers/lima/ir/pp/node_to_instr.c')
-rw-r--r--src/gallium/drivers/lima/ir/pp/node_to_instr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/lima/ir/pp/node_to_instr.c b/src/gallium/drivers/lima/ir/pp/node_to_instr.c
index a54be74ccfc..0d5d37f4927 100644
--- a/src/gallium/drivers/lima/ir/pp/node_to_instr.c
+++ b/src/gallium/drivers/lima/ir/pp/node_to_instr.c
@@ -88,7 +88,8 @@ static bool ppir_do_one_node_to_instr(ppir_block *block, ppir_node *node)
* by using pipeline reg ^vmul/^fmul */
ppir_alu_node *alu = ppir_node_to_alu(node);
if (alu->dest.type == ppir_target_ssa &&
- ppir_node_has_single_succ(node)) {
+ ppir_node_has_single_succ(node) &&
+ ppir_node_has_single_src_succ(node)) {
ppir_node *succ = ppir_node_first_succ(node);
if (succ->instr_pos == PPIR_INSTR_SLOT_ALU_VEC_ADD) {
node->instr_pos = PPIR_INSTR_SLOT_ALU_VEC_MUL;