[Polly] Add support for -polly-dump-before/after with NPM.
authorMichael Kruse <llvm-project@meinersbur.de>
Mon, 23 Aug 2021 01:35:14 +0000 (20:35 -0500)
committerMichael Kruse <llvm-project@meinersbur.de>
Mon, 23 Aug 2021 01:43:35 +0000 (20:43 -0500)
commit9cfab5e2491ec1fbf8a3055453b3da08ecacc6a6
tree99d845a13e87c9e23bf71fc89e8fb350cf3aa11b
parenta8de667af092c9b4b3b4a95827a521602ebf14ed
[Polly] Add support for -polly-dump-before/after with NPM.

The new pass manager does not allow adding module passes at the
-polly-position=before-vectorizer extension point. Introduce a
DumpFunctionPass that dumps only current function. In contrast to the
legacy pass manager's -polly-dump-before, each function will be dumped
into its own file. -polly-dump-before-file is still not supported.

The DumpFunctionPass uses llvm::CloneModule to copy the current function
into a new module and then write it into a file.
polly/include/polly/LinkAllPasses.h
polly/include/polly/Support/DumpFunctionPass.h [new file with mode: 0644]
polly/lib/CMakeLists.txt
polly/lib/Support/DumpFunctionPass.cpp [new file with mode: 0644]
polly/lib/Support/RegisterPasses.cpp
polly/test/Support/dumpfunction.ll [new file with mode: 0644]