[PATCH] D35807: Add test coverage for new PM PGOOpt handling.

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 25 18:03:57 PDT 2017


chandlerc added a comment.

Minor flag tweak...



================
Comment at: tools/opt/NewPMDriver.cpp:168-170
+  int NumPGOOptions = (PGOInstrGen.empty() ? 0 : 1) +
+                      (PGOInstrUse.empty() ? 0 : 1) +
+                      (PGOSampleUse.empty() ? 0 : 1);
----------------
What about a simpler factoring of flags:

  cl::opt<PGOKind> PGOKindFlag(
      cl::values(clEnumValN(PGOKind::InstrGen, "new-pm-pgo-instr-gen-pipeline", "..."),
                 clEnumValN(PGOKind::InstrUse, "new-pm-pgo-instr-use-pipeline", "..."),
                 clEnumValN(PGOKind::SampleUse, "new-pm-pgo-sample-use-pipeline", "...")));

  cl::opt<std::string> ProfileFile(...);


This would do the checking that only one kind is selected at a time for you I think.


https://reviews.llvm.org/D35807





More information about the llvm-commits mailing list