Skip to content

Commit 103d6db

Browse files
authored
AMDGPUPrintfRuntimeBinding: Do not set SPIR_FUNC calling convention. (#11)
1 parent c88332b commit 103d6db

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,6 @@ bool AMDGPUPrintfRuntimeBinding::lowerPrintfForGpu(Module &M) {
394394
Constant *PrintfAllocFn
395395
= M.getOrInsertFunction(StringRef("__printf_alloc"), FTy_alloc, Attr);
396396
Function *Afn = dyn_cast<Function>(PrintfAllocFn);
397-
Afn->setCallingConv(llvm::CallingConv::SPIR_FUNC);
398397
DEBUG(dbgs() << "inserting printf_alloc decl, an extern @ pre-link:");
399398
DEBUG(dbgs() << *Afn);
400399

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

425423
//
426424
// Insert code to split basicblock with a

test/CodeGen/AMDGPU/opencl-printf.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: opt -mtriple=amdgcn--amdhsa -amdgpu-printf-runtime-binding -mcpu=fiji -S < %s | FileCheck %s
22
; CHECK-LABEL: entry
3-
; CHECK: call spir_func i8 addrspace(1)* @__printf_alloc
3+
; CHECK: call i8 addrspace(1)* @__printf_alloc
44
; CHECK-LABEL: entry.split
55
; CHECK: icmp ne i8 addrspace(1)* %printf_alloc_fn, null
66
; CHECK: %PrintBuffID = getelementptr i8, i8 addrspace(1)* %printf_alloc_fn, i32 0

0 commit comments

Comments
 (0)