aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorJeremy Kun <jkun@google.com>2025-07-17 09:09:12 -0700
committerGitHub <noreply@github.com>2025-07-17 09:09:12 -0700
commit7caf12da0bb09d6b6992bf42afd256d453753dcb (patch)
tree5013224d03dc27bdb58c0ffb2d27c428e3087623 /clang/lib/Frontend/CompilerInvocation.cpp
parenta7f595efd840f7ed2210f2703048fad4d0027fac (diff)
downloadllvm-7caf12da0bb09d6b6992bf42afd256d453753dcb.zip
llvm-7caf12da0bb09d6b6992bf42afd256d453753dcb.tar.gz
llvm-7caf12da0bb09d6b6992bf42afd256d453753dcb.tar.bz2
[mlir][core] Add an MLIR "pattern catalog" generator (#146228)
This PR adds a feature that attaches a listener to all RewritePatterns that logs information about the modified operations. When the MLIR test suite is run, these debug outputs can be filtered and combined into an index linking operations to the patterns that insert, modify, or replace them. This index is intended to be used to create a website that allows one to look up patterns from an operation name. The debug logs emitted can be viewed with --debug-only=generate-pattern-catalog, and the lit config is modified to do this when the env var MLIR_GENERATE_PATTERN_CATALOG is set. Example usage: ``` mkdir build && cd build cmake -G Ninja ../llvm \ -DLLVM_ENABLE_PROJECTS="mlir" \ -DLLVM_TARGETS_TO_BUILD="host" \ -DCMAKE_BUILD_TYPE=DEBUG ninja -j 24 check-mlir MLIR_GENERATE_PATTERN_CATALOG=1 bin/llvm-lit -j 24 -v -a tools/mlir/test | grep 'pattern-logging-listener' | sed 's/^# | [pattern-logging-listener] //g' | sort | uniq > pattern_catalog.txt ``` Sample pattern catalog output (that fits in a gist): https://gist.github.com/j2kun/02d1ab8d31c10d71027724984c89905a --------- Co-authored-by: Jeremy Kun <j2kun@users.noreply.github.com> Co-authored-by: Mehdi Amini <joker.eph@gmail.com>
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions