mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
Repeat the optimization passes until we stop making progress.
This commit is contained in:
parent
6192434ac3
commit
2a7b2b22f4
2 changed files with 10 additions and 5 deletions
|
|
@ -754,11 +754,16 @@ main(int argc, char **argv)
|
|||
|
||||
/* Optimization passes */
|
||||
if (!state.error) {
|
||||
do_function_inlining(&instructions);
|
||||
bool progress;
|
||||
do {
|
||||
progress = false;
|
||||
|
||||
/* Constant folding */
|
||||
ir_constant_folding_visitor constant_folding;
|
||||
visit_exec_list(&instructions, &constant_folding);
|
||||
progress = do_function_inlining(&instructions) || progress;
|
||||
|
||||
/* Constant folding */
|
||||
ir_constant_folding_visitor constant_folding;
|
||||
visit_exec_list(&instructions, &constant_folding);
|
||||
} while (progress);
|
||||
}
|
||||
|
||||
/* Print out the resulting IR */
|
||||
|
|
|
|||
|
|
@ -307,7 +307,7 @@ can_inline(ir_call *call)
|
|||
bool
|
||||
do_function_inlining(exec_list *instructions)
|
||||
{
|
||||
bool progress;
|
||||
bool progress = false;
|
||||
|
||||
foreach_iter(exec_list_iterator, iter, *instructions) {
|
||||
ir_instruction *ir = (ir_instruction *)iter.get();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue