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

Kristof Beyls via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 21 00:11:23 PDT 2017


kristof.beyls added inline comments.


================
Comment at: lib/CodeGen/GlobalISel/Legalizer.cpp:204
+          DEBUG(dbgs() << ".. .. Emitted " << NumNewInsns << " insns\n");
+          for (SmallVector<MachineInstr *, 4>::iterator
+                   I = WorkList.end() - NumNewInsns,
----------------
aditya_nandakumar wrote:
> dsanders wrote:
> > kristof.beyls wrote:
> > > Minor nitpick: maybe use auto& here to make the code slightly more readable?
> > > Otherwise, LGTM.
> > Thanks.
> Quick question here - is it possible that one of the instructions could have been erased as it went through legalization (and we're trying to print it)?
I'm assuming that's not possible as the instructions being printed here are the ones added to the WorkList in this iteration, to be processed in future iterations. In other words, all of these MIs will be processed by legalizeInstrStep later on, so they shouldn't have been erased at this point.


https://reviews.llvm.org/D31750





More information about the llvm-commits mailing list