[PATCH] D18318: [AArch64][CodeGen] Fix of incorrect peephole optimization in AArch64InstrInfo::optimizeCompareInstr + peephole rules for Cmp+Brc

Evgeny Astigeevich via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 30 03:44:35 PDT 2016


eastig added inline comments.

================
Comment at: lib/Target/AArch64/AArch64InstrInfo.cpp:825
@@ +824,3 @@
+  // From must be above To.
+  assert(std::find_if(MachineBasicBlock::reverse_iterator(To),
+                   To->getParent()->rend(),
----------------
jmolloy wrote:
> Can you not just use
> 
>     std::find(MachineBasicBlock::reverse_iterator(To), To->getParent()->rend(), *From) ?
No, we cannot. '==' is not defined for MachineInstr. We can check either iterators or pointers.


http://reviews.llvm.org/D18318





More information about the llvm-commits mailing list