[llvm] 04b2f6e - [amdgpu][nfc] Drop dead PtrSet, fix a comment

Jon Chesterfield via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 9 09:05:42 PST 2021


Author: Jon Chesterfield
Date: 2021-12-09T17:05:20Z
New Revision: 04b2f6ea8ab35136041af2e372e1a639a7d869a3

URL: https://github.com/llvm/llvm-project/commit/04b2f6ea8ab35136041af2e372e1a639a7d869a3
DIFF: https://github.com/llvm/llvm-project/commit/04b2f6ea8ab35136041af2e372e1a639a7d869a3.diff

LOG: [amdgpu][nfc] Drop dead PtrSet, fix a comment

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp b/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
index 5310c542d356..894f341bb085 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
@@ -350,20 +350,14 @@ class AMDGPULowerModuleLDS : public ModulePass {
       refineUsesAlignmentAndAA(GEP, A, DL, AliasScope, NoAlias);
     }
 
-    // Mark kernels with asm that reads the address of the allocated structure
-    // This is not necessary for lowering. This lets other passes, specifically
-    // PromoteAlloca, accurately calculate how much LDS will be used by the
-    // kernel after lowering.
+    // This ensures the variable is allocated when called functions access it.
+    // It also lets other passes, specifically PromoteAlloca, accurately
+    // calculate how much LDS will be used by the kernel after lowering.
     if (!F) {
       IRBuilder<> Builder(Ctx);
-      SmallPtrSet<Function *, 32> Kernels;
       for (Function &Func : M.functions()) {
-        if (Func.isDeclaration())
-          continue;
-
-        if (AMDGPU::isKernelCC(&Func) && !Kernels.contains(&Func)) {
+        if (!Func.isDeclaration() && AMDGPU::isKernelCC(&Func)) {
           markUsedByKernel(Builder, &Func, SGV);
-          Kernels.insert(&Func);
         }
       }
     }


        


More information about the llvm-commits mailing list