[Mesa-dev] [PATCH 2/3] i965/fs: Clear variable from live-set if it's completely overwritten.
One program affected: instructions in affected programs: 246 -> 244 (-0.81%) --- src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp | 7 +++ 1 file changed, 7 insertions(+) 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 6addbb3..1ae7606 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 @@ -80,6 +80,13 @@ fs_visitor::dead_code_eliminate() } } + if (inst->dst.file == GRF) { +if (!inst->is_partial_write()) { + int var = live_intervals->var_from_reg(&inst->dst); + BITSET_CLEAR(live, var); +} + } + for (int i = 0; i < 3; i++) { if (inst->src[i].file == GRF) { int var = live_intervals->var_from_vgrf[inst->src[i].reg]; -- 1.8.3.2 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/3] i965/fs: Clear variable from live-set if it's completely overwritten.
Matt Turner writes: > One program affected: > > instructions in affected programs: 246 -> 244 (-0.81%) > --- > src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp | 7 +++ > 1 file changed, 7 insertions(+) > > 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 6addbb3..1ae7606 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 > @@ -80,6 +80,13 @@ fs_visitor::dead_code_eliminate() > } > } > > + if (inst->dst.file == GRF) { > +if (!inst->is_partial_write()) { > + int var = live_intervals->var_from_reg(&inst->dst); > + BITSET_CLEAR(live, var); > +} > + } Any more effect if you: + int var = live_intervals->var_from_vgrf[inst->dst.reg]; + for (int i = 0; i < inst->regs_written; i++) + BITSET_CLEAR(live, var + i); instead? pgpEZiXTiNn62.pgp Description: PGP signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/3] i965/fs: Clear variable from live-set if it's completely overwritten.
On Mon, Apr 14, 2014 at 5:50 PM, Eric Anholt wrote: > Matt Turner writes: > >> One program affected: >> >> instructions in affected programs: 246 -> 244 (-0.81%) >> --- >> src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp | 7 +++ >> 1 file changed, 7 insertions(+) >> >> 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 6addbb3..1ae7606 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 >> @@ -80,6 +80,13 @@ fs_visitor::dead_code_eliminate() >> } >> } >> >> + if (inst->dst.file == GRF) { >> +if (!inst->is_partial_write()) { >> + int var = live_intervals->var_from_reg(&inst->dst); >> + BITSET_CLEAR(live, var); >> +} >> + } > > Any more effect if you: > > + int var = live_intervals->var_from_vgrf[inst->dst.reg]; > + for (int i = 0; i < inst->regs_written; i++) > + BITSET_CLEAR(live, var + i); > > instead? Needs to be BITSET_CLEAR(live, var + inst->dst.reg_offset + i), but nope. No changes. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev