[llvm] [AMDGPU] Fix stack size metadata for functions with direct and indirect calls (PR #110828)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 2 04:42:21 PDT 2024


================
@@ -157,8 +157,12 @@ void MCResourceInfo::gatherResourceInfo(
       ArgExprs.push_back(
           MCConstantExpr::create(FRI.CalleeSegmentSize, OutContext));
 
-    if (!FRI.HasIndirectCall) {
-      for (const Function *Callee : FRI.Callees) {
+    SmallPtrSet<const Function *, 8> Seen;
+    Seen.insert(&MF.getFunction());
+    for (const Function *Callee : FRI.Callees) {
+      if (!Seen.insert(Callee).second)
----------------
arsenm wrote:

Not sure the repeated callee case is tested 

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


More information about the llvm-commits mailing list