LGTM, pushed, thanks.
On Thu, Dec 04, 2014 at 02:24:44PM +0800, Ruiling Song wrote: > The new bti implementation does not deal with printf internal buffer > specially. > Which cause printf print nothing! But I think it is better to declare the > internal buffer for printf in global memory space instead of private space. > Then the bti implementation don't have to deal with it specially. > > Signed-off-by: Ruiling Song <[email protected]> > --- > backend/src/llvm/llvm_printf_parser.cpp | 20 ++++++++++++++++---- > 1 file changed, 16 insertions(+), 4 deletions(-) > > diff --git a/backend/src/llvm/llvm_printf_parser.cpp > b/backend/src/llvm/llvm_printf_parser.cpp > index 11e9633..8fec683 100644 > --- a/backend/src/llvm/llvm_printf_parser.cpp > +++ b/backend/src/llvm/llvm_printf_parser.cpp > @@ -617,13 +617,25 @@ error: > > if (!pbuf_ptr) { > /* alloc a new buffer ptr to collect the print output. */ > - Type *ptrTy = Type::getInt32PtrTy(module->getContext()); > - llvm::Constant * pBuf = > module->getOrInsertGlobal(StringRef("__gen_ocl_printf_buf"), ptrTy); > + Type *ptrTy = Type::getInt32PtrTy(module->getContext(), 1); > + llvm::Constant *pBuf = new GlobalVariable(*module, ptrTy, false, > + GlobalVariable::ExternalLinkage, > + nullptr, > + StringRef("__gen_ocl_printf_buf"), > + nullptr, > + GlobalVariable::NotThreadLocal, > + 1); > pbuf_ptr = builder->CreatePtrToInt(pBuf, > Type::getInt32Ty(module->getContext())); > } > if (!index_buf_ptr) { > - Type *ptrTy = Type::getInt32PtrTy(module->getContext()); > - llvm::Constant * pBuf = > module->getOrInsertGlobal(StringRef("__gen_ocl_printf_index_buf"), ptrTy); > + Type *ptrTy = Type::getInt32PtrTy(module->getContext(), 1); > + llvm::Constant *pBuf = new GlobalVariable(*module, ptrTy, false, > + GlobalVariable::ExternalLinkage, > + nullptr, > + StringRef("__gen_ocl_printf_index_buf"), > + nullptr, > + GlobalVariable::NotThreadLocal, > + 1); > index_buf_ptr = builder->CreatePtrToInt(pBuf, > Type::getInt32Ty(module->getContext())); > } > > -- > 1.7.10.4 > > _______________________________________________ > Beignet mailing list > [email protected] > http://lists.freedesktop.org/mailman/listinfo/beignet _______________________________________________ Beignet mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/beignet
