i965: Fixup for don't dead-code eliminate instructions that write to the accumulator.
authorMatt Turner <mattst88@gmail.com>
Fri, 20 Sep 2013 02:31:31 +0000 (19:31 -0700)
committerMatt Turner <mattst88@gmail.com>
Mon, 7 Oct 2013 18:38:15 +0000 (11:38 -0700)
Accidentally pushed an old version of the patch.

v2: Set destination register using brw_null_reg().
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_vec4.cpp

index b83aca447e58b6d7f35397656f526b261f85d97a..d287bfdbd10264755f65949f95dec6e391239ba3 100644 (file)
@@ -1854,8 +1854,7 @@ fs_visitor::dead_code_eliminate()
             case BRW_OPCODE_ADDC:
             case BRW_OPCODE_SUBB:
             case BRW_OPCODE_MACH:
-               inst->dst.file = ARF;
-               inst->dst.reg = BRW_ARF_NULL;
+               inst->dst = fs_reg(retype(brw_null_reg(), inst->dst.type));
                break;
             default:
                inst->remove();
index 790ff2ebc721518ad67df5ba8f9f83106277aa7a..149a1a0e16519120ee1b5f941870703f3b000900 100644 (file)
@@ -322,8 +322,7 @@ vec4_visitor::dead_code_eliminate()
             case BRW_OPCODE_ADDC:
             case BRW_OPCODE_SUBB:
             case BRW_OPCODE_MACH:
-               inst->dst.file = ARF;
-               inst->dst.reg = BRW_ARF_NULL;
+               inst->dst = dst_reg(retype(brw_null_reg(), inst->dst.type));
                break;
             default:
                inst->remove();