diff options
author | Eric Anholt <eric@anholt.net> | 2010-04-08 13:42:48 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-04-08 13:43:56 -0700 |
commit | 2a7b2b22f47661029a1e8eea3d3765bd782412b3 (patch) | |
tree | d7cbe2023b0a6ba7c07b87ad219ac304b7746549 /glsl_parser_extras.cpp | |
parent | 6192434ac3bf621d600515589552100c8f5b8418 (diff) |
Repeat the optimization passes until we stop making progress.
Diffstat (limited to 'glsl_parser_extras.cpp')
-rw-r--r-- | glsl_parser_extras.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/glsl_parser_extras.cpp b/glsl_parser_extras.cpp index a4a67c8..38dee95 100644 --- a/glsl_parser_extras.cpp +++ b/glsl_parser_extras.cpp @@ -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 */ |