[llvm] [nfc] Improve testability of PGOInstrumentationGen (PR #104490)

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 15 13:46:23 PDT 2024


================
@@ -56,12 +56,14 @@ class PGOInstrumentationGenCreateVar
 /// The instrumentation (profile-instr-gen) pass for IR based PGO.
 class PGOInstrumentationGen : public PassInfoMixin<PGOInstrumentationGen> {
 public:
-  PGOInstrumentationGen(bool IsCS = false) : IsCS(IsCS) {}
+  PGOInstrumentationGen(bool IsCS = false, bool IsCtxProf = false)
----------------
snehasish wrote:

Can you convert this to an enum to explicitly callout the type of instrumentation instead of using booleans? Something like --
```
enum InstrumentationType {
  FDO =  0,
  CSFDO,
  CTXPROF
};
```

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


More information about the llvm-commits mailing list