compiler/glsl: Return progress from propagate_invariance()

Doing so allow you to easily tell what the pass did using the existing
infrastructure in the OPT macro.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10292>
This commit is contained in:
Matt Turner
2021-04-16 13:50:41 -04:00
committed by Marge Bot
parent 9fb1f9303b
commit 5ef4296cb6
3 changed files with 7 additions and 3 deletions

View File

@@ -113,13 +113,17 @@ ir_invariance_propagation_visitor::visit(ir_dereference_variable *ir)
return visit_continue;
}
void
bool
propagate_invariance(exec_list *instructions)
{
ir_invariance_propagation_visitor visitor;
bool progress = false;
do {
visitor.progress = false;
visit_list_elements(&visitor, instructions);
progress = progress || visitor.progress;
} while (visitor.progress);
return progress;
}