[PATCH] D48305: [IR] Introduce helpers to skip debug instructions (NFC)

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 19 13:00:23 PDT 2018


vsk added inline comments.


================
Comment at: lib/IR/Instruction.cpp:602
+      return I;
+  return nullptr;
+}
----------------
efriedma wrote:
> Maybe this should assert rather than return nullptr?  It's probably a logic error if you're calling getNextNonDebugInstruction() on a terminator.
Hm, but what about loops which advance an iterator using getNextNode()? Here's one from slp-vectorizer (at least, I think 'ScheduleEnd' can be nullptr here): `for (auto *I = ScheduleStart; I != ScheduleEnd; I = I->getNextNode())`. I'd like getNextNonDebugInst to be a drop-in in these cases.


https://reviews.llvm.org/D48305





More information about the llvm-commits mailing list