glsl/loops: Move some analysis from loop_controls to loop_analysis.
authorPaul Berry <stereotype441@gmail.com>
Thu, 28 Nov 2013 22:40:19 +0000 (14:40 -0800)
committerPaul Berry <stereotype441@gmail.com>
Mon, 9 Dec 2013 18:54:56 +0000 (10:54 -0800)
commitffc29120c402551fe9a7fa36e8ee5476bad27738
tree5ec4ccaa2c464f9f60c938eeacdaf70b7c6a61d4
parent4bbf6d1d2b20bccd784a326f33bdb860032db361
glsl/loops: Move some analysis from loop_controls to loop_analysis.

Previously, the sole responsibility of loop_analysis was to find all
the variables referenced in the loop that are either loop constant or
induction variables, and find all of the simple if statements that
might terminate the loop.  The remainder of the analysis necessary to
determine how many times a loop executed was performed by
loop_controls.

This patch makes loop_analysis also responsible for determining the
number of iterations after which each loop terminator will terminate
the loop, and for figuring out which terminator will terminate the
loop first (I'm calling this the "limiting terminator").

This will allow loop unrolling to make use of information that was
previously only visible from loop_controls, namely the identity of the
limiting terminator.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/loop_analysis.cpp
src/glsl/loop_analysis.h
src/glsl/loop_controls.cpp