summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Lehmann <dadschoorse@gmail.com>2022-09-28 14:37:19 +0200
committerMarge Bot <emma+marge@anholt.net>2022-11-28 18:43:53 +0000
commit7e1d77fd90bf810f4e4e2c5eef6da3c7416f88ed (patch)
tree059b6e434e1e93a8534614dea9fe4a338de693ac
parent65a3328b4c6f10e43da03417dcc5e8d33b61b0ad (diff)
aco: Ignore instructions with exec operands in follow_operand.
No Foz-DB changes. Signed-off-by: Georg Lehmann <dadschoorse@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18870>
-rw-r--r--src/amd/compiler/aco_optimizer.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp
index 211627d0854..6e519feeb96 100644
--- a/src/amd/compiler/aco_optimizer.cpp
+++ b/src/amd/compiler/aco_optimizer.cpp
@@ -2113,6 +2113,11 @@ follow_operand(opt_ctx& ctx, Operand op, bool ignore_uses = false)
return nullptr;
}
+ for (Operand& operand : instr->operands) {
+ if (fixed_to_exec(operand))
+ return nullptr;
+ }
+
return instr;
}
@@ -2445,8 +2450,6 @@ match_op3_for_vop3(opt_ctx& ctx, aco_opcode op1, aco_opcode op2, Instruction* op
Instruction* op2_instr = follow_operand(ctx, op1_instr->operands[swap]);
if (!op2_instr || op2_instr->opcode != op2)
return false;
- if (fixed_to_exec(op2_instr->operands[0]) || fixed_to_exec(op2_instr->operands[1]))
- return false;
VOP3_instruction* op1_vop3 = op1_instr->isVOP3() ? &op1_instr->vop3() : NULL;
VOP3_instruction* op2_vop3 = op2_instr->isVOP3() ? &op2_instr->vop3() : NULL;
@@ -2707,7 +2710,7 @@ combine_salu_n2(opt_ctx& ctx, aco_ptr<Instruction>& instr)
if (!op2_instr || (op2_instr->opcode != aco_opcode::s_not_b32 &&
op2_instr->opcode != aco_opcode::s_not_b64))
continue;
- if (ctx.uses[op2_instr->definitions[1].tempId()] || fixed_to_exec(op2_instr->operands[0]))
+ if (ctx.uses[op2_instr->definitions[1].tempId()])
continue;
if (instr->operands[!i].isLiteral() && op2_instr->operands[0].isLiteral() &&
@@ -2744,7 +2747,7 @@ combine_salu_lshl_add(opt_ctx& ctx, aco_ptr<Instruction>& instr)
if (!op2_instr || op2_instr->opcode != aco_opcode::s_lshl_b32 ||
ctx.uses[op2_instr->definitions[1].tempId()])
continue;
- if (!op2_instr->operands[1].isConstant() || fixed_to_exec(op2_instr->operands[0]))
+ if (!op2_instr->operands[1].isConstant())
continue;
uint32_t shift = op2_instr->operands[1].constantValue();