From bfe3fbb38e0a3ae7c1efb74282628c2cc5abc3e0 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 26 Aug 2010 16:43:57 -0700 Subject: glsl2: Add module to suss out loop control variables from loop analysis data This is the next step on the road to loop unrolling --- src/glsl/loop_analysis.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/glsl/loop_analysis.h') diff --git a/src/glsl/loop_analysis.h b/src/glsl/loop_analysis.h index 50c512f847..b7c0514943 100644 --- a/src/glsl/loop_analysis.h +++ b/src/glsl/loop_analysis.h @@ -36,6 +36,26 @@ extern class loop_state * 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 */ -- cgit v1.2.3