diff options
author | Connor Abbott <[email protected]> | 2019-07-27 20:24:32 +0200 |
---|---|---|
committer | Connor Abbott <[email protected]> | 2019-07-28 23:38:31 +0200 |
commit | 6fc7384fd44f0b42c6decac4468bba06b28a8186 (patch) | |
tree | 998dc4b342de8bffe9f4a6c9227891d7317e042c /src | |
parent | af95f80a24360ee30cffb35e386e93e94946204e (diff) |
lima/gpir/sched: Handle more special ops in can_use_complex()
We were missing handling for a few other ops that rearrange their
sources somehow in codegen, namely complex2 and select.
This should fix [email protected]@execution@built-in-functions@vs-asin-vec3
and possibly other random regressions from the new scheduler which were
supposed to be fixed in the commit right after.
Fixes: 54434fe6706 ("lima/gpir: Rework the scheduler")
Signed-off-by: Connor Abbott <[email protected]>
Acked-by: Qiang Yu <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/lima/ir/gp/scheduler.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/src/gallium/drivers/lima/ir/gp/scheduler.c b/src/gallium/drivers/lima/ir/gp/scheduler.c index 69606f22d51..35925a1af51 100644 --- a/src/gallium/drivers/lima/ir/gp/scheduler.c +++ b/src/gallium/drivers/lima/ir/gp/scheduler.c @@ -1114,13 +1114,32 @@ static bool can_use_complex(gpir_node *node) if (succ->type != gpir_node_type_alu) continue; + /* Note: this must be consistent with gpir_codegen_{mul,add}_slot{0,1} + */ gpir_alu_node *alu = gpir_node_to_alu(succ); - if (alu->num_child >= 2 && alu->children[1] == node) - return false; - - /* complex1 puts its third source in the fourth slot */ - if (alu->node.op == gpir_op_complex1 && alu->children[2] == node) + switch (alu->node.op) { + case gpir_op_complex1: + /* complex1 puts its third source in the fourth slot */ + if (alu->children[1] == node || alu->children[2] == node) + return false; + break; + case gpir_op_complex2: + /* complex2 has its source duplicated, since it actually takes two + * sources but we only ever use it with both sources the same. Hence + * its source can never be the complex slot. + */ return false; + case gpir_op_select: + /* Select has its sources rearranged */ + if (alu->children[0] == node) + return false; + break; + default: + assert(alu->num_child <= 2); + if (alu->num_child == 2 && alu->children[1] == node) + return false; + break; + } } return true; |