[PATCH] D92998: [CSSPGO][llvm-profgen] Pseudo probe based CS profile generation

Lei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 21 14:54:10 PST 2020


wlei marked 4 inline comments as done.
wlei added inline comments.


================
Comment at: llvm/tools/llvm-profgen/ProfileGenerator.cpp:42
   if (SampleType == PERF_LBR_STACK) {
+    // Enable context-sensitive functionalities in SampleProf
+    FunctionSamples::ProfileIsCS = true;
----------------
hoy wrote:
> The setting of the two flags should not be necessary on the profile generation side. They are used on the loader side. Do you see any issue without setting them?
Yeah, if not explicitly setting here, the value will be false.

you see in llvm/lib/Transforms/IPO/SampleProfile.cpp:

```
  // Apply tweaks if context-sensitive profile is available.
  if (Reader->profileIsCS()) {
    ProfileIsCS = true;
    FunctionSamples::ProfileIsCS = true;

    // Tracker for profiles under different context
    ContextTracker =
        std::make_unique<SampleContextTracker>(Reader->getProfiles());
  }
```
It's set when the reader know it's a CS profile. But for llvm-profgen side, it doesn't set this.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92998



More information about the llvm-commits mailing list