[llvm] Add flags to dump IR to a file before and after LLVM passes (PR #65179)

Nuri Amari via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 1 12:19:03 PDT 2023


================
@@ -69,6 +69,62 @@ class PrintIRInstrumentation {
   unsigned CurrentPassNumber = 0;
 };
 
+class DumpIRInstrumentation {
+public:
+  void registerCallbacks(PassInstrumentationCallbacks &PIC);
+
+private:
+  void dumpBeforePass(StringRef PassID, Any IR);
+  void dumpAfterPass(StringRef PassID, Any IR);
----------------
NuriAmari wrote:

I did not implement a `dumpAfterPassInvalidated` callback, mostly because I didn't understand when that occurs. If it makes sense to include one, I can.

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


More information about the llvm-commits mailing list