[PATCH] D88419: [RDA] Switch isSafeToMove iterators

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 01:07:46 PDT 2020


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

If Sam has no further questions, this looks good to me.



================
Comment at: llvm/lib/CodeGen/ReachingDefAnalysis.cpp:582
                                                 MachineInstr *To) const {
-  return isSafeToMove<MachineBasicBlock::iterator>(From, To);
+  using Iterator = MachineBasicBlock::reverse_iterator;
+  // Walk backwards until we find the instruction.
----------------
This code is an exact copy of the previous one, except one iterator. This can probably be refactored into one `IsSafeToMove` function that gets passed in this iterator. But it's a nit, up to you if it is worth doing this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88419



More information about the llvm-commits mailing list