diff options
author | Francisco Jerez <[email protected]> | 2016-03-13 16:25:57 -0700 |
---|---|---|
committer | Matt Turner <[email protected]> | 2020-03-06 10:20:57 -0800 |
commit | ea44de6d8c93551be73d91045686b59a5aa42c25 (patch) | |
tree | c145255d0a51688c7b55913f2a1c551475bebd2f /src/intel/compiler/brw_fs_dead_code_eliminate.cpp | |
parent | bb8cfa6837fe7967cb9b02e32bd2d1aa37631c45 (diff) |
intel/compiler/fs: Switch liveness analysis to IR analysis framework
This involves wrapping fs_live_variables in a BRW_ANALYSIS object and
hooking it up to invalidate_analysis() so it's properly invalidated.
Seems like a lot of churn but it's fairly straightforward. The
fs_visitor invalidate_ and calculate_live_intervals() methods are no
longer necessary after this change.
Reviewed-by: Matt Turner <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4012>
Diffstat (limited to 'src/intel/compiler/brw_fs_dead_code_eliminate.cpp')
-rw-r--r-- | src/intel/compiler/brw_fs_dead_code_eliminate.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/intel/compiler/brw_fs_dead_code_eliminate.cpp b/src/intel/compiler/brw_fs_dead_code_eliminate.cpp index 8e30e6de6ce..272b6c41b2d 100644 --- a/src/intel/compiler/brw_fs_dead_code_eliminate.cpp +++ b/src/intel/compiler/brw_fs_dead_code_eliminate.cpp @@ -76,21 +76,20 @@ fs_visitor::dead_code_eliminate() { bool progress = false; - calculate_live_intervals(); - - int num_vars = live_intervals->num_vars; + const fs_live_variables &live_vars = live_analysis.require(); + int num_vars = live_vars.num_vars; BITSET_WORD *live = rzalloc_array(NULL, BITSET_WORD, BITSET_WORDS(num_vars)); BITSET_WORD *flag_live = rzalloc_array(NULL, BITSET_WORD, 1); foreach_block_reverse_safe(block, cfg) { - memcpy(live, live_intervals->block_data[block->num].liveout, + memcpy(live, live_vars.block_data[block->num].liveout, sizeof(BITSET_WORD) * BITSET_WORDS(num_vars)); - memcpy(flag_live, live_intervals->block_data[block->num].flag_liveout, + memcpy(flag_live, live_vars.block_data[block->num].flag_liveout, sizeof(BITSET_WORD)); foreach_inst_in_block_reverse_safe(fs_inst, inst, block) { if (inst->dst.file == VGRF) { - const unsigned var = live_intervals->var_from_reg(inst->dst); + const unsigned var = live_vars.var_from_reg(inst->dst); bool result_live = false; for (unsigned i = 0; i < regs_written(inst); i++) @@ -111,7 +110,7 @@ fs_visitor::dead_code_eliminate() if (inst->dst.file == VGRF) { if (!inst->is_partial_write()) { - int var = live_intervals->var_from_reg(inst->dst); + const unsigned var = live_vars.var_from_reg(inst->dst); for (unsigned i = 0; i < regs_written(inst); i++) { BITSET_CLEAR(live, var + i); } @@ -128,7 +127,7 @@ fs_visitor::dead_code_eliminate() for (int i = 0; i < inst->sources; i++) { if (inst->src[i].file == VGRF) { - int var = live_intervals->var_from_reg(inst->src[i]); + int var = live_vars.var_from_reg(inst->src[i]); for (unsigned j = 0; j < regs_read(inst, i); j++) { BITSET_SET(live, var + j); |