aco/dead_code_analysis: don't add artificial uses to p_startpgm

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20853>
This commit is contained in:
Daniel Schürmann
2023-01-19 17:20:57 +01:00
committed by Marge Bot
parent fb99bc5f30
commit 7f7a70778f
2 changed files with 1 additions and 5 deletions
@@ -91,11 +91,6 @@ dead_code_analysis(Program* program)
process_block(ctx, program->blocks[next_block]);
}
/* add one use to exec to prevent startpgm from being removed */
aco_ptr<Instruction>& startpgm = program->blocks[0].instructions[0];
assert(startpgm->opcode == aco_opcode::p_startpgm);
ctx.uses[startpgm->definitions.back().tempId()]++;
return ctx.uses;
}
+1
View File
@@ -1784,6 +1784,7 @@ inline bool
is_dead(const std::vector<uint16_t>& uses, const Instruction* instr)
{
if (instr->definitions.empty() || instr->isBranch() ||
instr->opcode == aco_opcode::p_startpgm ||
instr->opcode == aco_opcode::p_init_scratch ||
instr->opcode == aco_opcode::p_dual_src_export_gfx11)
return false;