[PATCH] D156722: [CSSPGO] Support stale profile matching for LTO

Lei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 4 10:50:07 PDT 2023


wlei added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/SampleProfile.cpp:2139-2142
+              StringRef CalleeName =
+                  PrevDIL->getScope()->getSubprogram()->getLinkageName();
+              if (CalleeName.empty())
+                CalleeName = PrevDIL->getScope()->getSubprogram()->getName();
----------------
hoy wrote:
> nit: use `PrevDIL->getSubprogramLinkageName()` instead.
Done, thanks!


================
Comment at: llvm/lib/Transforms/IPO/SampleProfile.cpp:2146
+          }
+          continue;
+        }
----------------
hoy wrote:
> Is the `continue` needed since instructions in the same BB may not from a single callsite. 
We need the `continue`, this is needed for all the inlined code, because it's not part of the original function. 
otherwise the below code will extract the probe and callsite from a different function.

Note that this is under this condition, so it won't affect the original code.

```
 if (DIL->getInlinedAt()) { 
    ....
    continue;
   }
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156722



More information about the llvm-commits mailing list