[PATCH] D135106: [SPIRV] read kernel arg attributes from fuction/module metadata

Aleksandr Bezzubikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 4 20:39:08 PDT 2022


zuban32 added inline comments.


================
Comment at: llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp:152
+    if (MaybeValue &&
+        dyn_cast_or_null<Function>(MaybeValue->getValue())->getName() ==
+            KernelFunction.getName()) {
----------------
I don't think `dyn_cast_or_null` helps here, it wouldn't prevent segfault anyway. `dyn_cast` should work just as fine while keeping the code more uniform.


================
Comment at: llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp:187
+
+static std::vector<SPIRV::Decoration::Decoration>
+getKernelArgTypeQual(const Function &KernelFunction, unsigned ArgIdx) {
----------------
Why a vector here, do you plan to extend the list of possible decorations returned in the future?


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

https://reviews.llvm.org/D135106



More information about the llvm-commits mailing list