[llvm] [nfc][llvm-profdata]Refactor llvm-profdata showInstrProfile (PR #71328)

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 6 14:21:12 PST 2023


================
@@ -2406,6 +2407,14 @@ static void traverseAllValueSites(const InstrProfRecord &Func, uint32_t VK,
   }
 }
 
+namespace {
+struct InstrProfilePerFuncOptions {
----------------
minglotus-6 wrote:

Showing indirect call targets seems implicit currently; `showSampleProfile` doesn't take an option to suppress indirect call targets. 

A minor thing is, functions in sample profiles doesn't have mem-op size; so passing 'PerFuncOptions' in `showSampleProfile` static function would require an option invalidation 

```
if (PerFuncOptions.ShowMemOPSizes)
  emit error with message "mem-op size is not supported in sample profiles"
```


The struct is in anonymous namespace which makes it easier for renames if necessary. 

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


More information about the llvm-commits mailing list