[PATCH] D156869: Remark Util intoduce remark count

Zain Jaffal via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 2 02:41:56 PDT 2023


zjaffal created this revision.
zjaffal added reviewers: fhahn, anemet, paquette, thegameg.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
zjaffal requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This tool is a generic remark counter reporting count based on specified
properties. The counter can be used to count remarks individually and
filter them based on name, type and pass or count using remark
arguments.

Usage:
llvm-remarkutil count [options] <input file>

Options:

  --count-by=<value>      - Specify the property to collect remarks by
    =remark-name          -   Counts individual remarks based on how many of the remark exists
    =key                  -   Counts based on the value each specified key has. The key has to have a number value to be considered.
  --group-by=<value>      - Specify the property to groub remarks by
    =source               -   Display the count broken down by the filepath of each remark emitted. Requires remarks to have DebugLoc information.
    =function             -   Breakdown the count by function name.
    =function-with-loc    -   Breakdown the count by function name taking into consideration the filepath info from the DebugLoc of the remark.
    =total                -   Output the total number corresponding to the count for the provided input file
  --keys[=<keys>]           - Specify key(es) to count.
  -o <filename>           - Output
  --parser=<value>        - Input remark format to parse
    =yaml                 -   YAML
    =bitstream            -   Bitstream
  --pass-name[=<string>]    - optional remark pass name to filter collection by.
  --remark-name[=<string>]  - optional remark name to filter collection by.
  --remark-type=<value>   - remark name to collect using (accepts regular expressions)
    =unknown              -   UNKOWN
    =passed               -   PASSED
    =missed               -   MISSED
    =analysis             -   ANALYSIS
    =analysis-fp-commute  -   ANALYSIS_FP_COMMUTE
    =analysis-aliasing    -   ANALYSIS_ALIASING
    =failure              -   FAILURE
  --rkeys[=<keys>]          - Specify key(es) to count using regular expression.
  --rpass-name[=<string>]   - optional remark pass name to filter collection by (accepts regular expressions)
  --rremark-name[=<string>] - optional remark name to filter collection by (accepts regular expressions)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D156869

Files:
  llvm/docs/CommandGuide/llvm-remarkutil.rst
  llvm/include/llvm/Remarks/Remark.h
  llvm/lib/Remarks/Remark.cpp
  llvm/test/tools/llvm-remarkutil/annotation-count-with-dbg-loc.test
  llvm/test/tools/llvm-remarkutil/annotation-count.test
  llvm/test/tools/llvm-remarkutil/broken-bitstream-remark.test
  llvm/test/tools/llvm-remarkutil/broken-yaml-remark.test
  llvm/test/tools/llvm-remarkutil/count/Inputs/remark-count-by.yaml
  llvm/test/tools/llvm-remarkutil/count/Inputs/remark-filter-by.yaml
  llvm/test/tools/llvm-remarkutil/count/Inputs/remark-group-by.yaml
  llvm/test/tools/llvm-remarkutil/count/count-by-keys.test
  llvm/test/tools/llvm-remarkutil/count/count-by-remark.test
  llvm/test/tools/llvm-remarkutil/count/filter-by-pass-name.test
  llvm/test/tools/llvm-remarkutil/count/filter-by-remark-name.test
  llvm/test/tools/llvm-remarkutil/count/filter-by-type.test
  llvm/test/tools/llvm-remarkutil/count/group-by-function-with-loc.test
  llvm/test/tools/llvm-remarkutil/count/group-by-function.test
  llvm/test/tools/llvm-remarkutil/count/group-by-source.test
  llvm/test/tools/llvm-remarkutil/empty-file.test
  llvm/test/tools/llvm-remarkutil/instruction-count-with-dbg-loc.test
  llvm/test/tools/llvm-remarkutil/instruction-count.test
  llvm/tools/llvm-remarkutil/CMakeLists.txt
  llvm/tools/llvm-remarkutil/RemarkCounter.cpp
  llvm/tools/llvm-remarkutil/RemarkCounter.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156869.546369.patch
Type: text/x-patch
Size: 42107 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230802/a95c864f/attachment.bin>


More information about the llvm-commits mailing list