[PATCH] D78260: [MachineBasicBlock] Add helpers for skipping debug instructions [1/10]

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 16 03:23:26 PDT 2020


fhahn accepted this revision.
fhahn added a comment.
This revision is now accepted and ready to land.

LGTM, the set of patches to use the new utils shows that those utilities can be quite useful. Please wait a day or so with committing though, in case there are additional suggestions.



================
Comment at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1067
+template <typename IterT> inline IterT next_nodbg(IterT It, IterT End) {
+  return skipDebugInstructionsForward(std::next(It), End);
+}
----------------
It looks like some existing uses of skipDebugInstructionsForward could be replaced by next_nodbg().


================
Comment at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1073
+template <typename IterT> inline IterT prev_nodbg(IterT It, IterT Begin) {
+  return skipDebugInstructionsBackward(std::prev(It), Begin);
+}
----------------
It looks like some existing uses of skipDebugInstructionsBackward could be replaced by prev_nodbg().


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78260





More information about the llvm-commits mailing list