From b6d121502d8e66cd891f3386ccfb0aee0d8af310 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Thu, 14 May 2020 11:39:14 -0700 Subject: [PATCH] freedreno/ir3/dce: report progress Eventually we'll pull the iteration out of the pass itself, but the first step is to just report progress. Signed-off-by: Rob Clark Part-of: --- src/freedreno/ir3/ir3.h | 2 +- src/freedreno/ir3/ir3_dce.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/freedreno/ir3/ir3.h b/src/freedreno/ir3/ir3.h index 76fdcdf7a7d..3b4ffb29d29 100644 --- a/src/freedreno/ir3/ir3.h +++ b/src/freedreno/ir3/ir3.h @@ -1192,7 +1192,7 @@ void ir3_remove_nops(struct ir3 *ir); /* dead code elimination: */ struct ir3_shader_variant; -void ir3_dce(struct ir3 *ir, struct ir3_shader_variant *so); +bool ir3_dce(struct ir3 *ir, struct ir3_shader_variant *so); /* fp16 conversion folding */ void ir3_cf(struct ir3 *ir); diff --git a/src/freedreno/ir3/ir3_dce.c b/src/freedreno/ir3/ir3_dce.c index 0bd8af537f4..6c86d6356b8 100644 --- a/src/freedreno/ir3/ir3_dce.c +++ b/src/freedreno/ir3/ir3_dce.c @@ -178,17 +178,20 @@ find_and_remove_unused(struct ir3 *ir, struct ir3_shader_variant *so) return progress; } -void +bool ir3_dce(struct ir3 *ir, struct ir3_shader_variant *so) { void *mem_ctx = ralloc_context(NULL); - bool progress; + bool progress, made_progress = false; ir3_find_ssa_uses(ir, mem_ctx, true); do { progress = find_and_remove_unused(ir, so); + made_progress |= progress; } while (progress); ralloc_free(mem_ctx); + + return made_progress; } -- 2.30.2