aco/optimizer_postRA: Don't try to optimize dead instructions.

Also delete them when they are already dead in process_instruction().

No Fossil DB changes.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16266>
This commit is contained in:
Timur Kristóf 2022-08-06 11:58:50 +02:00 committed by Marge Bot
parent 4a4e5320a1
commit b0ef7c7c82

View file

@ -450,6 +450,13 @@ try_combine_dpp(pr_opt_ctx& ctx, aco_ptr<Instruction>& instr)
void
process_instruction(pr_opt_ctx& ctx, aco_ptr<Instruction>& instr)
{
/* Don't try to optimize instructions which are already dead. */
if (!instr || is_dead(ctx.uses, instr.get())) {
instr.reset();
ctx.current_instr_idx++;
return;
}
try_apply_branch_vcc(ctx, instr);
try_optimize_scc_nocompare(ctx, instr);