[PATCH] D22744: CodeExtractor : Add ability to preserve profile data.

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 30 21:13:43 PDT 2016


silvas added a comment.

Some nits.


================
Comment at: lib/Transforms/Utils/CodeExtractor.cpp:701
@@ +700,3 @@
+
+  // Add each of the frequencies of the successors
+  for (unsigned i = 0, e = TI->getNumSuccessors(); i < e; ++i) {
----------------
Missing '.' at the end of this comment.

================
Comment at: lib/Transforms/Utils/CodeExtractor.cpp:742
@@ +741,3 @@
+  // Calculate the entry of the new function before we change the root block.
+  BlockFrequency EntryFreq;
+  if (BFI) {
----------------
should this be "entry frequency" or "entry count" instead of just "entry"?

================
Comment at: lib/Transforms/Utils/CodeExtractor.cpp:777
@@ -707,1 +776,3 @@
+  DenseMap<BasicBlock *, BlockFrequency> ExitWeights;
   SmallPtrSet<BasicBlock *, 1> ExitBlocks;
+  for (BasicBlock *Block : Blocks) {
----------------
Add a comment here about what this loop is doing.

================
Comment at: lib/Transforms/Utils/CodeExtractor.cpp:800
@@ +799,3 @@
+  // Update the entry count of the function.
+  if (BFI) {
+    Optional<uint64_t> EntryCount =
----------------
The function is newly created, so this should probably say "Calculate and set" instead of "Update".


https://reviews.llvm.org/D22744





More information about the llvm-commits mailing list