[llvm] [AMDGPU] Add AMDGPU-specific module splitting (PR #89245)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu May 16 02:20:55 PDT 2024


================
@@ -358,22 +358,24 @@ struct KernelWithDependencies {
                          const DenseMap<const Function *, CostType> &FnCosts,
                          const Function *Fn)
       : Fn(Fn) {
-    addAllDependencies(SML, CG, *Fn, Dependencies, HasIndirectCall,
-                       HasExternallyVisibleDependecy);
+    addAllDependencies(SML, CG, *Fn, Dependencies, HasIndirectCall);
     TotalCost = FnCosts.at(Fn);
     for (const auto *Dep : Dependencies) {
       TotalCost += FnCosts.at(Dep);
-      HasExternallyVisibleDependecy |= Dep->hasExternalLinkage();
+
+      // We cannot duplicate functions with external linkage, or functions that
+      // may be overriden at runtime.
+      HasNonDuplicatableDependecy |=
+          (Dep->hasExternalLinkage() || !Dep->isDefinitionExact());
----------------
arsenm wrote:

Maybe this should be mayBeDerefined? I'm not a linkage expert, but it seems there's some nobuiltin interaction here too 

https://github.com/llvm/llvm-project/pull/89245


More information about the llvm-commits mailing list