[PATCH] D147710: Add an option to print out annotation remark count.

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 6 09:30:30 PDT 2023


paquette added inline comments.


================
Comment at: llvm/test/tools/llvm-remarkutil/Inputs/annotation-count.yaml:28
+  - type:            remark
\ No newline at end of file

----------------
probably need a newline here to make all YAML parsers work (I've had problems with MIR tests missing newlines at the end)


================
Comment at: llvm/tools/llvm-remarkutil/RemarkUtil.cpp:87
+static cl::opt<std::string>
+    RemarkToCollect("remark", cl::desc("remark to collect count for"),
+                    cl::sub(subopts::AnnotationCount));
----------------
thegameg wrote:
> I think `--remark` is too vague. It is very specific to the type of the annotation remark, so maybe `--annotation-type`?
+1


================
Comment at: llvm/tools/llvm-remarkutil/RemarkUtil.cpp:289
+  OF->os() << "Function,Count\n";
+  // Parse all remarks. Whenever we see an instruction count remark, output
+  // the file name and the number of instructions.
----------------
comment is incorrect


================
Comment at: llvm/tools/llvm-remarkutil/RemarkUtil.cpp:305
+    assert(CountArg != Remark.Args.end() &&
+           "Expected instruction count remarks to have a NumInstructions key?");
+    OF->os() << Remark.FunctionName << "," << CountArg->Val << "\n";
----------------
I think the message on this assert is incorrect


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147710/new/

https://reviews.llvm.org/D147710



More information about the llvm-commits mailing list