[PATCH] Add function entry count metadata.

Philip Reames listmail at philipreames.com
Tue May 12 17:14:16 PDT 2015


LGTM w/ minor comments addressed.  No further review needed.


================
Comment at: docs/BranchWeightMetadata.rst:124
@@ +123,3 @@
+analysis and optimization, ``MD_prof`` nodes can also be assigned to a
+function header. The first operator is a string indicating the name of
+the associated counter.
----------------
"function header"?  What's that?  I assume you mean the definition or declaration itself?

operand -> operator

================
Comment at: lib/IR/Verifier.cpp:1480
@@ +1479,3 @@
+             "expected string with name of the !prof annotation", MD);
+      MDString *MDS = dyn_cast<MDString>(MD->getOperand(0));
+      StringRef ProfName = MDS->getString();
----------------
cast rather than dyn_cast

================
Comment at: test/Verifier/function-metadata.ll:3
@@ +2,3 @@
+
+define i32 @bad1() !prof !0 {
+  ret i32 0
----------------
I still want to see a positive test example.  Your example from the documentation would be a good one.  Something to show that the profiling is valid when used properly.

http://reviews.llvm.org/D9628

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list