diff options
author | Ian Romanick <[email protected]> | 2010-08-26 16:43:57 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2010-09-03 11:55:21 -0700 |
commit | bfe3fbb38e0a3ae7c1efb74282628c2cc5abc3e0 (patch) | |
tree | 5720a17d39ab119c29591df50e925d3df394b7f0 /src/glsl/loop_analysis.h | |
parent | 9434a0749f26c640305f68ef85d17a31063a5705 (diff) |
glsl2: Add module to suss out loop control variables from loop analysis data
This is the next step on the road to loop unrolling
Diffstat (limited to 'src/glsl/loop_analysis.h')
-rw-r--r-- | src/glsl/loop_analysis.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/glsl/loop_analysis.h b/src/glsl/loop_analysis.h index 50c512f847f..b7c05149438 100644 --- a/src/glsl/loop_analysis.h +++ b/src/glsl/loop_analysis.h @@ -37,6 +37,26 @@ analyze_loop_variables(exec_list *instructions); /** + * Fill in loop control fields + * + * Based on analysis of loop variables, this function tries to remove sequences + * in the loop of the form + * + * (if (expression bool ...) (break)) + * + * and fill in the \c ir_loop::from, \c ir_loop::to, and \c ir_loop::counter + * fields of the \c ir_loop. + * + * In this process, some conditional break-statements may be eliminated + * altogether. For example, if it is provable that one loop exit condition will + * always be satisfied before another, the unnecessary exit condition will be + * removed. + */ +extern bool +set_loop_controls(exec_list *instructions, loop_state *ls); + + +/** * Tracking for all variables used in a loop */ class loop_variable_state : public exec_node { |