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

Ruiling Song ruiling.song at intel.com
Thu Aug 7 20:21:26 PDT 2014


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



More information about the Beignet mailing list