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 <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5048>
/* 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);
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;
}