Skip to content

AMDGPUPrintfRuntimeBinding: Do not set SPIR_FUNC calling convention. #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ bool AMDGPUPrintfRuntimeBinding::lowerPrintfForGpu(Module &M) {
Constant *PrintfAllocFn
= M.getOrInsertFunction(StringRef("__printf_alloc"), FTy_alloc, Attr);
Function *Afn = dyn_cast<Function>(PrintfAllocFn);
Afn->setCallingConv(llvm::CallingConv::SPIR_FUNC);
DEBUG(dbgs() << "inserting printf_alloc decl, an extern @ pre-link:");
DEBUG(dbgs() << *Afn);

Expand All @@ -420,7 +419,6 @@ bool AMDGPUPrintfRuntimeBinding::lowerPrintfForGpu(Module &M) {
alloc_args.push_back(sumC);
CallInst *pcall = CallInst::Create( Afn, alloc_args,
"printf_alloc_fn", CI);
pcall->setCallingConv(llvm::CallingConv::SPIR_FUNC);

//
// Insert code to split basicblock with a
Expand Down
2 changes: 1 addition & 1 deletion test/CodeGen/AMDGPU/opencl-printf.ll
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; RUN: opt -mtriple=amdgcn--amdhsa -amdgpu-printf-runtime-binding -mcpu=fiji -S < %s | FileCheck %s
; CHECK-LABEL: entry
; CHECK: call spir_func i8 addrspace(1)* @__printf_alloc
; CHECK: call i8 addrspace(1)* @__printf_alloc
; CHECK-LABEL: entry.split
; CHECK: icmp ne i8 addrspace(1)* %printf_alloc_fn, null
; CHECK: %PrintBuffID = getelementptr i8, i8 addrspace(1)* %printf_alloc_fn, i32 0
Expand Down