[PATCH] D39480: Include GUIDs from the same module when computing GUIDs that needs to be imported.

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 1 11:31:25 PDT 2017


tejohnson added inline comments.


================
Comment at: include/llvm/ProfileData/SampleProf.h:375
       for (const auto &NameFS : CS.second)
         NameFS.second.findImportedFunctions(S, M, Threshold);
   }
----------------
Needs update for name change?


================
Comment at: lib/Transforms/IPO/SampleProfile.cpp:1468
+    // Sets the GUIDs that are inlined in the profiled binary. This is used
+    // for ThinLink to make correct liveness analysis.
+    F.setEntryCount(Samples->getHeadSamples() + 1, &InlinedGUIDs);
----------------
I would leave the old reason too - it's both right? Making the IR match before annotation and getting the correct liveness analysis, for anything that couldn't be inlined during the compile step.


================
Comment at: test/Transforms/SampleProfile/function_metadata.ll:36
+; to foo_available.
+; CHECK: ![[ENTRY_TEST_LIVENESS]] = !{!"function_entry_count", i64 1, i64 4005816710939881937, i64 6699318081062747564}
 
----------------
I think you also need to add a second module to test for the A.c:foo() ->(direct or indirect)-> B.c:bar() ->(indirect)-> A.c:baz() case.


https://reviews.llvm.org/D39480





More information about the llvm-commits mailing list