[llvm] [Instrumentation] Support MachineFunction in ChangeReporter (PR #80946)

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 7 13:19:50 PST 2024


================
@@ -357,9 +381,11 @@ void ChangeReporter<T>::saveIRBeforePass(Any IR, StringRef PassID,
                                          StringRef PassName) {
   // Is this the initial IR?
   if (InitialIR) {
-    InitialIR = false;
-    if (VerboseMode)
-      handleInitialIR(IR);
+    if (const auto *MF = unwrapIR<MachineFunction>(IR); !MF || !MF->empty()) {
----------------
aeubanks wrote:

is the intention here to make the output of instruction selection the "initial IR"?

I feel like being explicit about the fact that instruction selection is actually modifying the MachineFunction is reasonable, so the initial IR being empty isn't too bad. but I'm open to this as well

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


More information about the llvm-commits mailing list