[PATCH] D50200: AMDGPU: Handle "uniform-work-group-size" attribute

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 10 20:50:00 PDT 2018


arsenm added inline comments.


================
Comment at: lib/Target/AMDGPU/AMDGPUAnnotateKernelFeatures.cpp:241
+        CallingConv::ID CC = F.getCallingConv();
+        if (ST.isAmdHsaOS()) {
+          if (CC == CallingConv::AMDGPU_KERNEL) {
----------------
OS check isn't necessary


================
Comment at: lib/Target/AMDGPU/AMDGPUAnnotateKernelFeatures.cpp:244-245
+            //Check for uniform workgroup size attribute
+            if (F.hasFnAttribute("uniform-work-group-size")) {
+              if (Callee->hasFnAttribute("uniform-work-group-size")) {
+                Attribute attr = Callee->getFnAttribute("uniform-work-group-size");
----------------
I don't see how this prevents propagating the attribute if other callers do not have it


================
Comment at: lib/Target/AMDGPU/AMDGPUAnnotateKernelFeatures.cpp:247-249
+                if (attr.getValueAsString().equals("false"))
+                  continue;
+                else if (attr.getValueAsString().equals("true"))
----------------
Should only be looking for == "true"


================
Comment at: lib/Target/AMDGPU/AMDGPUTargetMachine.cpp:671
+
+  if (TM->getTargetTriple().getArch() == Triple::amdgcn )
+    addPass(createAMDGPUAnnotateKernelFeaturesPass());
----------------
Extra space at end


================
Comment at: lib/Target/AMDGPU/AMDGPUTargetMachine.cpp:756
   // supported.
-  addPass(createAMDGPUAnnotateKernelFeaturesPass());
+  //addPass(createAMDGPUAnnotateKernelFeaturesPass());
 
----------------
Delete


================
Comment at: test/CodeGen/AMDGPU/uniform-workgroup-test1.ll:1
+define void @foo() #0 {
+  ret void
----------------
Tests are missing run lines


================
Comment at: test/CodeGen/AMDGPU/uniform-workgroup-test1.ll:25-30
+attributes #0 = {nounwind "uniform-work-group-size"="true"}
+attributes #1 = {nounwind "amdgpu-dispatch-ptr" }
+attributes #2 = {"amdgpu-work-item-id-y" "uniform-work-group-size"="true"}
+attributes #3 = {"uniform-work-group-size"="false"}
+attributes #4 = {"uniform-work-group-size"="true"}
+
----------------
This includes attributes added by the pass


https://reviews.llvm.org/D50200





More information about the llvm-commits mailing list