From c24dd54f973d1a42b0e2cc81aa219bb58f7523d9 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 24 Sep 2014 13:16:43 -0700 Subject: [PATCH] i965/fs: Fix a bug with dead_code_eliminate on large writes 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 Reviewed-by: Matt Turner --- src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp b/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp index 3cb63399d3e..0d26103cc66 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp @@ -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); } -- 2.30.2