From cd2a6045296f4434c48b6a42c16669873ca4be76 Mon Sep 17 00:00:00 2001 From: Junyan He Date: Tue, 17 Nov 2015 07:40:17 +0800 Subject: 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 Reviewed-by: Yang Rong --- 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 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(&v))->second); - regTranslator.newScalarProxy(ir::ocl::printfbptr, const_cast(&v)); + this->newRegister(const_cast(&v), NULL, true); + ctx.CVT(ir::TYPE_U32, ir::TYPE_U64, getRegister(const_cast(&v)), ir::ocl::printfbptr); } else if(v.getName().equals(StringRef("__gen_ocl_printf_index_buf"))) { ctx.getFunction().getPrintfSet()->setIndexBufBTI(BtiMap.find(const_cast(&v))->second); - regTranslator.newScalarProxy(ir::ocl::printfiptr, const_cast(&v)); + this->newRegister(const_cast(&v), NULL, true); + ctx.CVT(ir::TYPE_U32, ir::TYPE_U64, getRegister(const_cast(&v)), ir::ocl::printfiptr); } else if(v.getName().equals(StringRef("__gen_ocl_profiling_buf"))) { ctx.getUnit().getProfilingInfo()->setBTI(BtiMap.find(const_cast(&v))->second); regTranslator.newScalarProxy(ir::ocl::profilingbptr, const_cast(&v)); -- cgit v1.2.3