Mesa (master): nir: Release per-block metadata in nir_sweep

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Dec 16 22:42:06 UTC 2018


Module: Mesa
Branch: master
Commit: 9dc135efa1f3edf344ba57e1bbe076c805c8903a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9dc135efa1f3edf344ba57e1bbe076c805c8903a

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Mon Nov 26 15:12:30 2018 -0800

nir: Release per-block metadata in nir_sweep

nir_sweep already marks all metadata invalid, so it is safe to release
the memory here too.

mean soft fp64 using uint64:   1,342,759,331 => 1,010,670,475
gfxbench5 aztec ruins high 11:    63,555,571 =>    61,889,811
deus ex mankind divided 148:      62,845,304 =>    62,829,640
deus ex mankind divided 2890:     71,922,686 =>    71,922,686
dirt showdown 676:                69,238,607 =>    69,238,607
dolphin ubershaders 210:          77,822,072 =>    77,822,072

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

---

 src/compiler/nir/nir_sweep.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/compiler/nir/nir_sweep.c b/src/compiler/nir/nir_sweep.c
index aab641388d..b6b56aa078 100644
--- a/src/compiler/nir/nir_sweep.c
+++ b/src/compiler/nir/nir_sweep.c
@@ -63,6 +63,15 @@ sweep_block(nir_shader *nir, nir_block *block)
 {
    ralloc_steal(nir, block);
 
+   /* sweep_impl will mark all metadata invalid.  We can safely release all of
+    * this here.
+    */
+   ralloc_free(block->live_in);
+   block->live_in = NULL;
+
+   ralloc_free(block->live_out);
+   block->live_out = NULL;
+
    nir_foreach_instr(instr, block) {
       ralloc_steal(nir, instr);
 




More information about the mesa-commit mailing list