summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRhys Perry <pendingchaos02@gmail.com>2019-11-18 21:00:17 +0000
committerRhys Perry <pendingchaos02@gmail.com>2019-12-02 16:56:24 +0000
commit01cacdb71ee45067dd8fa48298530bd8a05c53d0 (patch)
tree195368fdfa44064cb829c903d76e39e8d4dfda12
parent0e8da9f60718520d1c3abd335a047282bb760b78 (diff)
aco: fix block_kind_discard s_andn2 definition to exec
Improves generated code of dEQP-VK.graphicsfuzz.disc-and-add-in-func-in-loop because a loop exit phi can then be fixed to exec, removing copies and improving jump threading. No pipeline-db changes. Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
-rw-r--r--src/amd/compiler/aco_insert_exec_mask.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/amd/compiler/aco_insert_exec_mask.cpp b/src/amd/compiler/aco_insert_exec_mask.cpp
index ba0d1f04a01..31ae5ca658c 100644
--- a/src/amd/compiler/aco_insert_exec_mask.cpp
+++ b/src/amd/compiler/aco_insert_exec_mask.cpp
@@ -886,6 +886,8 @@ void add_branch_code(exec_ctx& ctx, Block* block)
for (int i = num - 1; i >= 0; i--) {
Instruction *andn2 = bld.sop2(aco_opcode::s_andn2_b64, bld.def(s2), bld.def(s1, scc),
ctx.info[block->index].exec[i].first, cond);
+ if (i == (int)ctx.info[idx].exec.size() - 1)
+ andn2->definitions[0].setFixed(exec);
if (i == 0)
bld.pseudo(aco_opcode::p_exit_early_if, bld.scc(andn2->definitions[1].getTemp()));
ctx.info[block->index].exec[i].first = andn2->definitions[0].getTemp();