From 21ba2bc595402180fa52d793bb1e524663788338 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Mon, 23 Mar 2020 20:44:27 +0000 Subject: [PATCH] aco: remove dead code in handle_operands() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_lower_to_hw_instr.cpp | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/src/amd/compiler/aco_lower_to_hw_instr.cpp b/src/amd/compiler/aco_lower_to_hw_instr.cpp index c555ccdfa85..240f6c3a373 100644 --- a/src/amd/compiler/aco_lower_to_hw_instr.cpp +++ b/src/amd/compiler/aco_lower_to_hw_instr.cpp @@ -790,16 +790,13 @@ void handle_operands(std::map& copy_map, lower_context* return; /* all target regs are needed as operand somewhere which means, all entries are part of a cycle */ - bool constants = false; for (it = copy_map.begin(); it != copy_map.end(); ++it) { assert(it->second.op.isFixed()); if (it->first == it->second.op.physReg()) continue; - /* do constants later */ - if (it->second.op.isConstant()) { - constants = true; - continue; - } + + /* should already be done */ + assert(!it->second.op.isConstant()); if (preserve_scc && it->second.def.getTemp().type() == RegType::sgpr) assert(!(it->second.def.physReg() == pi->scratch_sgpr)); @@ -846,19 +843,6 @@ void handle_operands(std::map& copy_map, lower_context* } } } - - /* copy constants into a registers which were operands */ - if (constants) { - for (it = copy_map.begin(); it != copy_map.end(); ++it) { - if (!it->second.op.isConstant()) - continue; - if (it->second.def.physReg() == scc) { - bld.sopc(aco_opcode::s_cmp_lg_i32, Definition(scc, s1), Operand(0u), Operand(it->second.op.constantValue() ? 1u : 0u)); - } else { - bld.copy(it->second.def, it->second.op); - } - } - } } void lower_to_hw_instr(Program* program) -- 2.30.2