[PATCH] D110337: [AMDGPU] Use "hostcall" module flag instead of searching for ockl_hostcall_internal() declaration.
Konstantin Pyzhov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 5 18:42:26 PDT 2021
kpyzhov updated this revision to Diff 377413.
kpyzhov added a comment.
Corrected "duplicate flag" error.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D110337/new/
https://reviews.llvm.org/D110337
Files:
llvm/lib/Transforms/Utils/AMDGPUEmitPrintf.cpp
Index: llvm/lib/Transforms/Utils/AMDGPUEmitPrintf.cpp
===================================================================
--- llvm/lib/Transforms/Utils/AMDGPUEmitPrintf.cpp
+++ llvm/lib/Transforms/Utils/AMDGPUEmitPrintf.cpp
@@ -63,7 +63,9 @@
auto Int64Ty = Builder.getInt64Ty();
auto M = Builder.GetInsertBlock()->getModule();
auto Fn = M->getOrInsertFunction("__ockl_printf_begin", Int64Ty, Int64Ty);
- M->addModuleFlag(llvm::Module::Override, "amdgpu_hostcall", 1);
+ if (!M->getModuleFlag("amdgpu_hostcall")) {
+ M->addModuleFlag(llvm::Module::Override, "amdgpu_hostcall", 1);
+ }
return Builder.CreateCall(Fn, Version);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110337.377413.patch
Type: text/x-patch
Size: 647 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211006/e520ef3f/attachment.bin>
More information about the llvm-commits
mailing list