[clang-tools-extra] Add flags to dump IR to a file before and after LLVM passes (PR #65179)

2023-09-07 Thread Nuri Amari via cfe-commits
NuriAmari wrote: > What about an option that just redirects the PrintIRInstrumentation output to > files instead of stderr? The files can be something like `$N-$modulename.ll` > where `$N` is an int that increments. Yeah that's more or less what I'm working on now. My plan is: - Add a flag th

[clang-tools-extra] Add flags to dump IR to a file before and after LLVM passes (PR #65179)

2023-09-07 Thread Arthur Eubanks via cfe-commits
aeubanks wrote: What about an option that just redirects the PrintIRInstrumentation output to files instead of stderr? The files can be something like `$N-$modulename.ll` where `$N` is an int that increments. https://github.com/llvm/llvm-project/pull/65179 _

[clang-tools-extra] Add flags to dump IR to a file before and after LLVM passes (PR #65179)

2023-09-07 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari closed https://github.com/llvm/llvm-project/pull/65179 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add flags to dump IR to a file before and after LLVM passes (PR #65179)

2023-09-06 Thread Nuri Amari via cfe-commits
NuriAmari wrote: I've tried this on a real application, and the output paths quickly get extremely long. So long that we fail to create the directory structure. Perhaps the nesting idea isn't the right choice after all. https://github.com/llvm/llvm-project/pull/65179 __

[clang-tools-extra] Add flags to dump IR to a file before and after LLVM passes (PR #65179)

2023-09-06 Thread Nuri Amari via cfe-commits
@@ -0,0 +1,71 @@ +; RUN: mkdir -p %t/logs +; 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 -dump-after=no-op-module -dump-before=no-op-module +; RUN: find %t/logs -type f

[clang-tools-extra] Add flags to dump IR to a file before and after LLVM passes (PR #65179)

2023-09-06 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari updated https://github.com/llvm/llvm-project/pull/65179: >From 5d395c85b84e5a554df4b092014d38123e666c6c Mon Sep 17 00:00:00 2001 From: Nuri Amari Date: Tue, 29 Aug 2023 10:10:57 -0700 Subject: [PATCH 1/4] Add flags to dump IR to a file before and after LLVM passes

[clang-tools-extra] Add flags to dump IR to a file before and after LLVM passes (PR #65179)

2023-09-03 Thread Min-Yih Hsu via cfe-commits
@@ -830,6 +831,182 @@ void PrintIRInstrumentation::registerCallbacks( } } +void DumpIRInstrumentation::registerCallbacks( +PassInstrumentationCallbacks &PIC) { + + if (!(shouldDumpBeforeSomePass() || shouldDumpAfterSomePass())) +return; + + this->PIC = &PIC; + + P

[clang-tools-extra] Add flags to dump IR to a file before and after LLVM passes (PR #65179)

2023-09-03 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari updated https://github.com/llvm/llvm-project/pull/65179: >From 5d395c85b84e5a554df4b092014d38123e666c6c Mon Sep 17 00:00:00 2001 From: Nuri Amari Date: Tue, 29 Aug 2023 10:10:57 -0700 Subject: [PATCH 1/3] Add flags to dump IR to a file before and after LLVM passes

[clang-tools-extra] Add flags to dump IR to a file before and after LLVM passes (PR #65179)

2023-09-03 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari updated https://github.com/llvm/llvm-project/pull/65179: >From 5d395c85b84e5a554df4b092014d38123e666c6c Mon Sep 17 00:00:00 2001 From: Nuri Amari Date: Tue, 29 Aug 2023 10:10:57 -0700 Subject: [PATCH 1/2] Add flags to dump IR to a file before and after LLVM passes