prog_optimize: Only merge writes to temporary registers

In one optimization pass, register files may have been messed therefore
merging instructions which use the same index in two different register
files.
This commit is contained in:
Benjamin Segovia 2010-08-16 20:40:09 -07:00 committed by Ian Romanick
parent 608f749ec3
commit 5a38e70d59

View file

@ -758,7 +758,11 @@ _mesa_remove_extra_moves(struct gl_program *prog)
nesting--; nesting--;
break; break;
case OPCODE_MOV: case OPCODE_MOV:
if (i > 0 && can_downward_mov_be_modifed(mov) && nesting == 0) { if (i > 0 &&
can_downward_mov_be_modifed(mov) &&
mov->SrcReg[0].File == PROGRAM_TEMPORARY &&
nesting == 0)
{
/* see if this MOV can be removed */ /* see if this MOV can be removed */
const GLuint id = mov->SrcReg[0].Index; const GLuint id = mov->SrcReg[0].Index;