[PATCH] D31750: [globalisel] Enable tracing the legalizer with --debug-only=legalize-mir

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 18 03:58:56 PDT 2017


dsanders added inline comments.


================
Comment at: lib/CodeGen/GlobalISel/LegalizerHelper.cpp:74-77
+  MIRBuilder.recordInsertions([&](MachineInstr *MI) {
+    DEBUG(DebugReportList.push_back(MI));
+    WorkList.push_back(MI);
+  });
----------------
dsanders wrote:
> kristof.beyls wrote:
> > This patch looks pretty straightforward.
> > I'm just wondering why you don't just directly print out the New MI here and instead use a data structure to record it and print it out later?
> I didn't give it enough thought to notice it was redundant :-). I'll make it emit it directly once I've finished updating the other patches.
I got around to trying to make this change and remembered why I recorded the MI and printed it out afterwards. The operands haven't been added to the instruction at the point that recordInsertions() is called so it only prints the opcode. This makes it hard to trace the changes the pass is making.


https://reviews.llvm.org/D31750





More information about the llvm-commits mailing list