Skip to content

Commit bf24179

Browse files
kpyzhovmemfrob
authored andcommitted
[AMDGPU] Correction to 095c48fdf3d27a4f346f8680d1d7e89449bb557b.
Differential Revision: https://reviews.llvm.org/D110337
1 parent 472477c commit bf24179

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/lib/Transforms/Utils/AMDGPUEmitPrintf.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ static Value *callPrintfBegin(IRBuilder<> &Builder, Value *Version) {
6363
auto Int64Ty = Builder.getInt64Ty();
6464
auto M = Builder.GetInsertBlock()->getModule();
6565
auto Fn = M->getOrInsertFunction("__ockl_printf_begin", Int64Ty, Int64Ty);
66-
M->addModuleFlag(llvm::Module::Override, "amdgpu_hostcall", 1);
66+
if (!M->getModuleFlag("amdgpu_hostcall")) {
67+
M->addModuleFlag(llvm::Module::Override, "amdgpu_hostcall", 1);
68+
}
6769
return Builder.CreateCall(Fn, Version);
6870
}
6971

0 commit comments

Comments
 (0)