From c7d05141686ecd6266683f11fb5423b6545c49a4 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Mon, 20 Jan 2020 16:22:56 +0000 Subject: [PATCH] aco: parallelcopy exec mask before s_wqm MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It can be used later and we want any uses to not be fixed to exec, so it's definition can't be fixed to exec because of how exec masks interact with register demand calculation. Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_insert_exec_mask.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/amd/compiler/aco_insert_exec_mask.cpp b/src/amd/compiler/aco_insert_exec_mask.cpp index 539d0a2580b..44da289339b 100644 --- a/src/amd/compiler/aco_insert_exec_mask.cpp +++ b/src/amd/compiler/aco_insert_exec_mask.cpp @@ -315,6 +315,13 @@ void transition_to_WQM(exec_ctx& ctx, Builder bld, unsigned idx) return; if (ctx.info[idx].exec.back().second & mask_type_global) { Temp exec_mask = ctx.info[idx].exec.back().first; + /* TODO: we might generate better code if we pass the uncopied "exec_mask" + * directly to the s_wqm (we still need to keep this parallelcopy for + * potential later uses of exec_mask though). We currently can't do this + * because of a RA bug. */ + exec_mask = bld.pseudo(aco_opcode::p_parallelcopy, bld.def(bld.lm), bld.exec(exec_mask)); + ctx.info[idx].exec.back().first = exec_mask; + exec_mask = bld.sop1(Builder::s_wqm, bld.def(bld.lm, exec), bld.def(s1, scc), exec_mask); ctx.info[idx].exec.emplace_back(exec_mask, mask_type_global | mask_type_wqm); return; -- 2.30.2