[llvm] Add option to dump IR to files instead of stderr (PR #66412)

Nuri Amari via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 28 12:56:33 PDT 2023


================
@@ -0,0 +1,56 @@
+; RUN: rm -rf %t/logs
+
+; Basic dump before and after a single module pass
+
+; RUN: opt %s -disable-output -passes='no-op-module' -ir-dump-directory %t/logs -print-after=no-op-module -print-before=no-op-module
----------------
NuriAmari wrote:

Yes, but I'm not sure how stable the passes that run are. Even though I only ask to run various no-op passes, a couple more run implicitly. If that changes, and we assert the numbers themselves, the test will break:

```
0-d2b22a3c72db5719-module-NoOpModulePass-after.ll
1-d2b22a3c72db5719-scc-815922cdb8ef56e8-NoOpCGSCCPass-after.ll
2-d2b22a3c72db5719-scc-5525c0ec6c125513-NoOpCGSCCPass-after.ll
3-d2b22a3c72db5719-function-dcb27518fed9d577-NoOpFunctionPass-after.ll
4-d2b22a3c72db5719-function-003934191339461a-NoOpFunctionPass-after.ll
5-d2b22a3c72db5719-function-dcb27518fed9d577-LoopSimplifyPass-after.ll
6-d2b22a3c72db5719-function-dcb27518fed9d577-LCSSAPass-after.ll
7-d2b22a3c72db5719-function-003934191339461a-LoopSimplifyPass-after.ll
8-d2b22a3c72db5719-function-003934191339461a-LCSSAPass-after.ll
9-d2b22a3c72db5719-loop-f8786d034c39b728-NoOpLoopPass-after.ll
10-d2b22a3c72db5719-module-NoOpModulePass-after.ll
11-d2b22a3c72db5719-module-VerifierPass-after.ll
```

https://github.com/llvm/llvm-project/pull/66412


More information about the llvm-commits mailing list