[Mesa-dev] [PATCH 10/19] i965/fs: Drop redundant zero assignments in fs_inst::init().

Kenneth Graunke kenneth at whitecape.org
Fri Feb 21 13:44:55 PST 2014


On 02/20/2014 01:41 PM, Matt Turner wrote:
> Unfortunately the compiler isn't able to recognize that assigning
> reg_undef is just zeroing the fs_reg, which was already done by the
> above memset.
> ---
>  src/mesa/drivers/dri/i965/brw_fs.cpp | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
> index ae1237e..e51cdbd 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> @@ -56,12 +56,6 @@ fs_inst::init()
>  {
>     memset(this, 0, sizeof(*this));
>     this->opcode = BRW_OPCODE_NOP;
> -   this->conditional_mod = BRW_CONDITIONAL_NONE;
> -
> -   this->dst = reg_undef;
> -   this->src[0] = reg_undef;
> -   this->src[1] = reg_undef;
> -   this->src[2] = reg_undef;
>  
>     /* This will be the case for almost all instructions. */
>     this->regs_written = 1;
> 

This is not equivalent.

reg_undef has stride == 1.  Removing these lines will make stride == 0.

--Ken

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140221/8b8d7bed/attachment-0001.pgp>


More information about the mesa-dev mailing list