[Mesa-dev,09/16] mesa: Slightly change instruction walking behavior for prog_optimize.

Submitted by Eric Anholt on May 28, 2014, 6:37 p.m.

Details

Message ID 1401302267-5038-10-git-send-email-eric@anholt.net
State New
Headers show

Not browsing as part of any series.

Commit Message

Eric Anholt May 28, 2014, 6:37 p.m.
I was going to change this when I moved to lists of instructions, and
wanted to call the behavior change out here.  Note that the last
instruction is always OPCODE_END, and can_upward_mov_be_modified will
notice that it's not a MOV and take the continue path (to the exit of the
loop).
---
 src/mesa/program/prog_optimize.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/mesa/program/prog_optimize.c b/src/mesa/program/prog_optimize.c
index e877497..ce53937 100644
--- a/src/mesa/program/prog_optimize.c
+++ b/src/mesa/program/prog_optimize.c
@@ -509,7 +509,7 @@  _mesa_remove_extra_move_use(struct gl_program *prog)
     *    FOO tmpY, arg0, arg1;
     */
 
-   for (i = 0; i + 1 < prog->NumInstructions; i++) {
+   for (i = 0; i < prog->NumInstructions; i++) {
       const struct prog_instruction *mov = prog->Instructions + i;
       GLuint dst_mask, src_mask;
       if (can_upward_mov_be_modifed(mov) == GL_FALSE)