[Mesa-dev] [PATCH] i965: Remove useless IR self-destruct backend_shader method.

Francisco Jerez currojerez at riseup.net
Wed Mar 9 01:35:30 UTC 2016


>From the point it's constructed the CFG contains the only existing
copy of the program IR, and it never becomes invalid.  Calling
backend_shader::invalidate_cfg would have destroyed the program
structure irrecoverably -- We weren't calling it at all for a good
reason.
---
 src/mesa/drivers/dri/i965/brw_shader.cpp | 7 -------
 src/mesa/drivers/dri/i965/brw_shader.h   | 1 -
 2 files changed, 8 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
index dfe6afc..21977a2 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.cpp
+++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
@@ -1046,13 +1046,6 @@ backend_shader::calculate_cfg()
    cfg = new(mem_ctx) cfg_t(&this->instructions);
 }
 
-void
-backend_shader::invalidate_cfg()
-{
-   ralloc_free(this->cfg);
-   this->cfg = NULL;
-}
-
 /**
  * Sets up the starting offsets for the groups of binding table entries
  * commong to all pipeline stages.
diff --git a/src/mesa/drivers/dri/i965/brw_shader.h b/src/mesa/drivers/dri/i965/brw_shader.h
index 82374a4..15bed78 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.h
+++ b/src/mesa/drivers/dri/i965/brw_shader.h
@@ -217,7 +217,6 @@ public:
    virtual void dump_instructions(const char *name);
 
    void calculate_cfg();
-   void invalidate_cfg();
 
    virtual void invalidate_live_intervals() = 0;
 };
-- 
2.7.0



More information about the mesa-dev mailing list