[Beignet] [PATCH] GBE: initialize BTI structure to zero.

Yang, Rong R rong.r.yang at intel.com
Sun Aug 10 19:36:41 PDT 2014


I think it is better to do this in the BTI's constructor.

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Ruiling Song
> Sent: Friday, August 08, 2014 11:21 AM
> To: beignet at lists.freedesktop.org
> Cc: Song, Ruiling
> Subject: [Beignet] [PATCH] GBE: initialize BTI structure to zero.
> 
> Clear to zero to avoid garbage data, as we do not assign it later for
> local/constant memory access.
> 
> Signed-off-by: Ruiling Song <ruiling.song at intel.com>
> ---
>  backend/src/llvm/llvm_gen_backend.cpp |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/backend/src/llvm/llvm_gen_backend.cpp
> b/backend/src/llvm/llvm_gen_backend.cpp
> index d2e0c87..eb06d9f 100644
> --- a/backend/src/llvm/llvm_gen_backend.cpp
> +++ b/backend/src/llvm/llvm_gen_backend.cpp
> @@ -3444,6 +3444,8 @@ handle_write_image:
>      const ir::AddressSpace addrSpace =
> addressSpaceLLVMToGen(llvmSpace);
>      const ir::Register ptr = this->getRegister(llvmPtr);
>      ir::BTI binding;
> +    memset(&binding, 0, sizeof(ir::BTI));
> +
>      if(addrSpace == ir::MEM_GLOBAL || addrSpace == ir::MEM_PRIVATE) {
>        gatherBTI(llvmPtr, binding);
>      }
> --
> 1.7.10.4
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list