[PATCH] D55987: [CodeGen] Skip over dbg-instr in twoaddr pass

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 2 11:05:55 PST 2019


aprantl accepted this revision.
aprantl added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lib/CodeGen/TwoAddressInstructionPass.cpp:933
+  while (End != MBB->end()) {
+    End = skipDebugInstructionsForward(End, MBB->end());
+    if (End->isCopy() && regOverlapsSet(Defs, End->getOperand(1).getReg(), TRI))
----------------
markus wrote:
> Of course if 'End == MBB->end()' after this point bad things would happen, but on the other hand that would also have been problematic in the original loop (and apparently it was not a problem in practice). Perhaps simply adding an assertion to indicate that this has been considered would be sufficient?
The last instruction pretty much has to be a terminator instruction and can't really be a debug intrinsic.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55987/new/

https://reviews.llvm.org/D55987





More information about the llvm-commits mailing list