[PATCH] D23424: AMDGPU: Add hidden kernel arguments to runtime metadata

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 17 11:46:16 PDT 2016


arsenm added inline comments.

================
Comment at: lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp:884
@@ +883,3 @@
+static void emitRuntimeMetadataForKernelArg(const DataLayout &DL,
+    std::unique_ptr<MCStreamer> &OutStreamer, Type *T,
+    RuntimeMD::KernelArg::Kind Kind,
----------------
Should Pass MCStreamer & instead of unique_ptr &

================
Comment at: lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp:938-939
@@ +937,4 @@
+  if (auto *PT = dyn_cast<PointerType>(T)) {
+    RuntimeMD::KernelArg::AddressSpaceQualifer Addr;
+    switch(PT->getAddressSpace()) {
+    case 1:
----------------
Space before (. Should also move switch into function with return instead of assign and break

================
Comment at: lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp:940
@@ +939,3 @@
+    switch(PT->getAddressSpace()) {
+    case 1:
+      Addr = RuntimeMD::KernelArg::Global;
----------------
Should use enum

================
Comment at: lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp:1005
@@ +1004,3 @@
+      .Default(!isa<PointerType>(T) ? RuntimeMD::KernelArg::ByValue :
+                   T->getPointerAddressSpace() == 3 ?
+                   RuntimeMD::KernelArg::DynamicSharedPointer :
----------------
Enum. Remove ! and swap order


https://reviews.llvm.org/D23424





More information about the llvm-commits mailing list