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

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 18 21:05:50 PST 2019


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp:425
+        Func.getParent()->getFunction("__ockl_hostcall_internal");
+    if (Func.getParent()->getNamedMetadata("llvm.printf.fmts")) {
+      if (HostcallUsed) {
----------------
I would reorder these to try hostcall first, but it's not important


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp:427
+      if (HostcallUsed) {
+        OutContext.reportError({}, "Cannot use both hostcall and printf.");
+        return;
----------------
This should probably be using the LLVMContext error, instead of the MCContext error to at least report the function context in the error, e.g:


```
    DiagnosticInfoUnsupported NoGraphicsHSA(
        Fn, "unsupported non-compute shaders with HSA", DL.getDebugLoc());
    DAG.getContext()->diagnose(NoGraphicsHSA);
```

There should also be a testcase hitting this error


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