glsl2: Add module to suss out loop control variables from loop analysis data

This is the next step on the road to loop unrolling
This commit is contained in:
Ian Romanick
2010-08-26 16:43:57 -07:00
parent 9434a0749f
commit bfe3fbb38e
4 changed files with 305 additions and 1 deletions

View File

@@ -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
*/