i965/fs: Fix a bug with dead_code_eliminate on large writes
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 24 Sep 2014 20:16:43 +0000 (13:16 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 30 Sep 2014 17:29:13 +0000 (10:29 -0700)
Previously, if an instruction wrote to more than one register, we
implicitly assumed that it filled the entire register.  We never hit this
before because the only time we did multi-register writes was things like
texturing which always wrote to all of the registers.  However, with the
upcoming ability to do 16-wide instructions in SIMD8 and things of that
nature, we can have multi-register writes at offsets and we'll hit this.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp

index 3cb63399d3ef165a777b00d05a38ba173dcac45b..0d26103cc6629bedbd2afce248552ceb4b10785b 100644 (file)
@@ -58,7 +58,7 @@ fs_visitor::dead_code_eliminate()
                int var = live_intervals->var_from_reg(&inst->dst);
                result_live = BITSET_TEST(live, var);
             } else {
-               int var = live_intervals->var_from_vgrf[inst->dst.reg];
+               int var = live_intervals->var_from_reg(&inst->dst);
                for (int i = 0; i < inst->regs_written; i++) {
                   result_live = result_live || BITSET_TEST(live, var + i);
                }