aco: Move is_dead to aco_ir.h to allow it to get inlined.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18103>
This commit is contained in:
Timur Kristóf
2022-10-06 10:21:55 -05:00
committed by Marge Bot
parent 36bc3afb8b
commit 0cceab788e
2 changed files with 14 additions and 13 deletions

View File

@@ -80,18 +80,6 @@ process_block(dce_ctx& ctx, Block& block)
} /* end namespace */
bool
is_dead(const std::vector<uint16_t>& uses, Instruction* instr)
{
if (instr->definitions.empty() || instr->isBranch() ||
instr->opcode == aco_opcode::p_init_scratch)
return false;
if (std::any_of(instr->definitions.begin(), instr->definitions.end(),
[&uses](const Definition& def) { return !def.isTemp() || uses[def.tempId()]; }))
return false;
return !(get_sync_info(instr).semantics & (semantic_volatile | semantic_acqrel));
}
std::vector<uint16_t>
dead_code_analysis(Program* program)
{