[PATCH] D78151: [AArch64InstrInfo] Ignore debug insts in canInstrSubstituteCmpInstr

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 15 02:41:52 PDT 2020


fhahn added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64InstrInfo.cpp:1450
     const MachineInstr &Instr = *I;
+    if (Instr.isDebugInstr())
+      continue;
----------------
It seems like a few similar changes popped up recently. It might be worth making it a bit easier to iterate over a range of MIs while skipping debug instructions automatically. It's quite easy to construct iterator ranges that skip debug instructions (see snippet below). It might be worth adding a helpers like that. They could also naturally be used for the existing skipDebugInstructionsBackward/skipDebugInstructionsForward

```
+  auto MIsWithoutDbg =
+      make_filter_range(make_range(std::next(CmpInstr->getIterator()),
+                                   CmpInstr->getParent()->instr_end()),
+                        [](MachineInstr &I) { return !I.isDebugInstr(); });
+  for (const MachineInstr &Instr : MIsWithoutDbg) {
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78151





More information about the llvm-commits mailing list