[Beignet] [PATCH 15/19] Backend: Fix two bugs about curbe related pointer.

junyan.he at inbox.com junyan.he at inbox.com
Tue Sep 8 17:01:06 PDT 2015


From: Junyan He <junyan.he at linux.intel.com>

1. rename __gen_ocl_timestamp_buf to __gen_ocl_profiling_buf
2. printfbptr printfiptr and profilingbptr should be 64 bits
   on BDW later platforms. So just set them to QWORD.

Signed-off-by: Junyan He <junyan.he at linux.intel.com>
---
 backend/src/ir/profile.cpp            |    6 +++---
 backend/src/llvm/llvm_gen_backend.cpp |    8 +++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/backend/src/ir/profile.cpp b/backend/src/ir/profile.cpp
index ad343d5..3de1ef7 100644
--- a/backend/src/ir/profile.cpp
+++ b/backend/src/ir/profile.cpp
@@ -92,12 +92,12 @@ namespace ir {
       DECL_NEW_REG(FAMILY_DWORD, one, 1);
       DECL_NEW_REG(FAMILY_WORD, retVal, 1);
       DECL_NEW_REG(FAMILY_DWORD, slmoffset, 1);
-      DECL_NEW_REG(FAMILY_DWORD, printfbptr, 1);
-      DECL_NEW_REG(FAMILY_DWORD, printfiptr, 1);
+      DECL_NEW_REG(FAMILY_QWORD, printfbptr, 1);
+      DECL_NEW_REG(FAMILY_QWORD, printfiptr, 1);
       DECL_NEW_REG(FAMILY_DWORD, dwblockip, 0);
       DECL_NEW_REG(FAMILY_DWORD, invalid, 1);
       DECL_NEW_REG(FAMILY_DWORD, btiUtil, 1);
-      DECL_NEW_REG(FAMILY_DWORD, profilingbptr, 1);
+      DECL_NEW_REG(FAMILY_QWORD, profilingbptr, 1);
       DECL_NEW_REG(FAMILY_DWORD, profilingts0, 0);
       DECL_NEW_REG(FAMILY_DWORD, profilingts1, 0);
       DECL_NEW_REG(FAMILY_DWORD, profilingts2, 0);
diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp
index 5c2b590..233f7e2 100644
--- a/backend/src/llvm/llvm_gen_backend.cpp
+++ b/backend/src/llvm/llvm_gen_backend.cpp
@@ -1112,7 +1112,7 @@ namespace gbe
     } else if (origin->getName().equals(StringRef("__gen_ocl_printf_index_buf"))) {
       new_bti = btiBase;
       incBtiBase();
-    } else if (origin->getName().equals(StringRef("__gen_ocl_timestamp_buf"))) {
+    } else if (origin->getName().equals(StringRef("__gen_ocl_profiling_buf"))) {
       new_bti = btiBase;
       incBtiBase();
     }
@@ -2484,10 +2484,12 @@ namespace gbe
       } else {
         if(v.getName().equals(StringRef("__gen_ocl_printf_buf"))) {
           ctx.getFunction().getPrintfSet()->setBufBTI(BtiMap.find(const_cast<GlobalVariable*>(&v))->second);
-          regTranslator.newScalarProxy(ir::ocl::printfbptr, const_cast<GlobalVariable*>(&v));
+          this->newRegister(const_cast<GlobalVariable*>(&v), NULL, true);
+          ctx.CVT(ir::TYPE_U32, ir::TYPE_U64, getRegister(const_cast<GlobalVariable*>(&v)), ir::ocl::printfbptr);
         } else if(v.getName().equals(StringRef("__gen_ocl_printf_index_buf"))) {
           ctx.getFunction().getPrintfSet()->setIndexBufBTI(BtiMap.find(const_cast<GlobalVariable*>(&v))->second);
-          regTranslator.newScalarProxy(ir::ocl::printfiptr, const_cast<GlobalVariable*>(&v));
+          this->newRegister(const_cast<GlobalVariable*>(&v), NULL, true);
+          ctx.CVT(ir::TYPE_U32, ir::TYPE_U64, getRegister(const_cast<GlobalVariable*>(&v)), ir::ocl::printfiptr);
         } else if(v.getName().equals(StringRef("__gen_ocl_profiling_buf"))) {
           ctx.getUnit().getProfilingInfo()->setBTI(BtiMap.find(const_cast<GlobalVariable*>(&v))->second);
           regTranslator.newScalarProxy(ir::ocl::profilingbptr, const_cast<GlobalVariable*>(&v));
-- 
1.7.9.5





More information about the Beignet mailing list