There are several extension points available, which can be used during the registration of a new pass. I am curious of the IR code looks at each stage. Is there a possibility to retrieve the IR code after an extension point before the rest of the pass pipeline is executed?
-print-before/after=<pass name>? Or you can write your own PassInstrumentation and register with PassBuilder.