[PATCH] D22600: [PGO] Fix profile mismatch in Comdat function with pre-inliner

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 21 00:14:23 PDT 2016


silvas accepted this revision.
silvas added a comment.
This revision is now accepted and ready to land.

I think this is a good solution. LGTM although I'd like to wait for other reviewers to chime in.

FWIW, one alternative solution to this issue (and the static var name issue that Jake fixed recently) is to make it so that multiple functions with same name and different hash can coexist naturally. I haven't looked closely, but this would require changing quite a bit (e.g. indexed format, various API's, etc.). So at the moment I don't think it is worth it since this patch + Jake's patch are relatively small.


================
Comment at: lib/Transforms/Instrumentation/PGOInstrumentation.cpp:988
@@ -881,2 +987,3 @@
   std::vector<Function *> ColdFunctions;
+  InstrProfSummaryBuilder Builder(ProfileSummaryBuilder::DefaultCutoffs);
   for (auto &F : M) {
----------------
Is this variable `Builder` needed?


https://reviews.llvm.org/D22600





More information about the llvm-commits mailing list