[PATCH] D70038: [AMDGPU] add support for hostcall buffer pointer as hidden kernel argument

Sameer Sahasrabuddhe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 19 05:26:49 PST 2019


sameerds marked an inline comment as done.
sameerds added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp:587
+    for (auto &U : HostcallFunction->uses()) {
+      if (auto *CI = dyn_cast<CallInst>(U.getUser())) {
+        M.getContext().emitError(CI, "Cannot use both printf and hostcall in the same module");
----------------
arsenm wrote:
> Should use CallBase in case an invoke is is ever used
I don't really see how we could possibly see an invoke for __ockl_hostcall_internal(). If possible, we would probably mark it as nothrow or something in the library sources. I don't have much of a preference either way, but it seems cleaner to keep the CallInst precisely to document the fact that we don't expect to see an invoke here, and also to match the nearby check for calls to printf itself.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70038/new/

https://reviews.llvm.org/D70038





More information about the llvm-commits mailing list