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

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 24 11:28:42 PDT 2017


davide requested changes to this revision.
davide added a comment.
This revision now requires changes to proceed.

This is a step in the right direction, some comments inline.



================
Comment at: lib/Passes/PassBuilder.cpp:1109
 
+/// Use user specifiy -pgo-opt option to override PGOOpt
+static void processPGOOpt(Optional<PGOOptions> &PGOOpt) {
----------------
s/Use/Process/ ?


================
Comment at: lib/Passes/PassBuilder.cpp:1116
+    report_fatal_error("Invalid -pgo-opt.");
+    return;
+  }
----------------
Do you need return after fatal?


================
Comment at: lib/Passes/PassBuilder.cpp:1118
+  }
+  PGOOptions pgoopt;
+  std::string command = PGOOptString.substr(0, pos);
----------------
Capital P


================
Comment at: lib/Passes/PassBuilder.cpp:1120-1135
+  if (command == "gen") {
+    pgoopt.ProfileGenFile = PGOOptString.substr(pos + 1);
+    pgoopt.RunProfileGen = true;
+  } else if (command == "use") {
+    pgoopt.ProfileUseFile = PGOOptString.substr(pos + 1);
+  } else if (command == "sample-gen") {
+    // FIXME: add -fdebug-info-for-profiling logic
----------------
`StringSwitch` maybe?


https://reviews.llvm.org/D35807





More information about the llvm-commits mailing list