[PATCH] D131276: AMDGPU: Implicit kernel arguments related optimization when uniform-workgroup-size=true

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 20 11:16:35 PDT 2022


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULowerKernelAttributes.cpp:47-49
+  BLOCK_COUNT_X = 0,
+  BLOCK_COUNT_Y = 4,
+  BLOCK_COUNT_Z = 8,
----------------
Should be named HIDDEN_BLOCK_*?


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULowerKernelAttributes.cpp:91
 
-  Value *WorkGroupSizeX = nullptr;
-  Value *WorkGroupSizeY = nullptr;
-  Value *WorkGroupSizeZ = nullptr;
-
-  Value *GridSizeX = nullptr;
-  Value *GridSizeY = nullptr;
-  Value *GridSizeZ = nullptr;
+  Value *BlockCounts[3] = {nullptr, nullptr, nullptr};
+  Value *GroupSizes[3]  = {nullptr, nullptr, nullptr};
----------------
Hidden?


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULowerKernelAttributes.cpp:336-337
 
-  Function *DispatchPtr = M.getFunction(DispatchPtrName);
-  if (!DispatchPtr) // Dispatch ptr not used.
+    if (!DispatchPtr) // Dispatch ptr not used.
     return false;
 
----------------
Looks like something weird is happening with the return indentation


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULowerKernelAttributes.cpp:376
 
+  bool IsV5OrAbove = AMDGPU::getAmdhsaCodeObjectVersion() >= 5;
   for (Instruction &I : instructions(F)) {
----------------
This isn't reading the IR/module flag


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULowerKernelAttributes.cpp:381
+        processUse(CI, true);
+      if (!IsV5OrAbove && CI->getCalledFunction() == DispatchPtr)
+        processUse(CI, false);
----------------
else if


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

https://reviews.llvm.org/D131276



More information about the llvm-commits mailing list