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

Kenneth Graunke kenneth at whitecape.org
Wed Mar 9 09:02:53 UTC 2016


On Tuesday, March 8, 2016 5:35:30 PM PST Francisco Jerez wrote:
> 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;
>  };
> 

Yep.  This was useful back in the old days, when we stored the program
as a flat list of instructions, and kept the CFG as a data structure off
to the side.  We'd have to invalidate it and recompute it.

But then Matt made everything preserve the CFG, and made it essential.
So invalidating it is indeed just going to blow things up :)

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160309/3d00e0f1/attachment-0001.sig>


More information about the mesa-dev mailing list