Mesa (main): intel/compiler: Update block IPs once in dead_code_eliminate

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 14 17:20:18 UTC 2021


Module: Mesa
Branch: main
Commit: f3f3817307c0a4e04dc340331361f5f31d45d3c8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f3f3817307c0a4e04dc340331361f5f31d45d3c8

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Mon Jun 28 19:02:40 2021 -0700

intel/compiler: Update block IPs once in dead_code_eliminate

Performance improvement in
dEQP-VK.ssbo.phys.layout.random.16bit.scalar.13 for n=30:

release build (w/Fedora build flags): -7.79% ± 0.25%
Meson -Dbuildtype=debugoptimized:     -5.10% ± 0.40%

The difference in the debugoptimized build is the calls to
inst_is_in_block(block, this) still exist on each call to remove().

v2: Only update each block's IP data once instead of once per block.
Suggested by Emma.

Reviewed-by: Emma Anholt <emma at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11632>

---

 src/intel/compiler/brw_fs_dead_code_eliminate.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/intel/compiler/brw_fs_dead_code_eliminate.cpp b/src/intel/compiler/brw_fs_dead_code_eliminate.cpp
index 272b6c41b2d..21f6f903df0 100644
--- a/src/intel/compiler/brw_fs_dead_code_eliminate.cpp
+++ b/src/intel/compiler/brw_fs_dead_code_eliminate.cpp
@@ -121,7 +121,7 @@ fs_visitor::dead_code_eliminate()
             flag_live[0] &= ~inst->flags_written();
 
          if (inst->opcode == BRW_OPCODE_NOP) {
-            inst->remove(block);
+            inst->remove(block, true);
             continue;
          }
 
@@ -139,6 +139,8 @@ fs_visitor::dead_code_eliminate()
       }
    }
 
+   cfg->adjust_block_ips();
+
    ralloc_free(live);
    ralloc_free(flag_live);
 



More information about the mesa-commit mailing list