summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunyan He <junyan.he@linux.intel.com>2015-11-17 07:40:17 +0800
committerYang Rong <rong.r.yang@intel.com>2015-11-17 16:23:51 +0800
commitcd2a6045296f4434c48b6a42c16669873ca4be76 (patch)
treea8c29f95d119a20e7ad95a383fa3548dc0168f34
parentc8be81b8c2b6a4caa56a2419f3b9ed39de5043d0 (diff)
Backend: Fix two bugs about curbe related pointer.
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@linux.intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
-rw-r--r--backend/src/ir/profile.cpp6
-rw-r--r--backend/src/llvm/llvm_gen_backend.cpp8
2 files changed, 8 insertions, 6 deletions
diff --git a/backend/src/ir/profile.cpp b/backend/src/ir/profile.cpp
index 90b039b9..75e669d4 100644
--- a/backend/src/ir/profile.cpp
+++ b/backend/src/ir/profile.cpp
@@ -87,10 +87,10 @@ namespace ir {
DECL_NEW_REG(FAMILY_DWORD, zero, 1);
DECL_NEW_REG(FAMILY_DWORD, one, 1);
DECL_NEW_REG(FAMILY_WORD, retVal, 1);
- DECL_NEW_REG(FAMILY_DWORD, printfbptr, 1, GBE_CURBE_PRINTF_BUF_POINTER);
- DECL_NEW_REG(FAMILY_DWORD, printfiptr, 1, GBE_CURBE_PRINTF_INDEX_POINTER);
+ DECL_NEW_REG(FAMILY_QWORD, printfbptr, 1, GBE_CURBE_PRINTF_BUF_POINTER);
+ DECL_NEW_REG(FAMILY_QWORD, printfiptr, 1, GBE_CURBE_PRINTF_INDEX_POINTER);
DECL_NEW_REG(FAMILY_DWORD, dwblockip, 0, GBE_CURBE_DW_BLOCK_IP);
- DECL_NEW_REG(FAMILY_DWORD, profilingbptr, 1, GBE_CURBE_PROFILING_BUF_POINTER);
+ DECL_NEW_REG(FAMILY_QWORD, profilingbptr, 1, GBE_CURBE_PROFILING_BUF_POINTER);
DECL_NEW_REG(FAMILY_DWORD, profilingts0, 0, GBE_CURBE_PROFILING_TIMESTAMP0);
DECL_NEW_REG(FAMILY_DWORD, profilingts1, 0, GBE_CURBE_PROFILING_TIMESTAMP1);
DECL_NEW_REG(FAMILY_DWORD, profilingts2, 0, GBE_CURBE_PROFILING_TIMESTAMP2);
diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp
index 84a4f0d0..d1b6f986 100644
--- a/backend/src/llvm/llvm_gen_backend.cpp
+++ b/backend/src/llvm/llvm_gen_backend.cpp
@@ -1089,7 +1089,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();
}
@@ -2566,10 +2566,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));