[PATCH] D27792: IfConversion: Use reverse_iterator to simplify. NFC

Kyle Butt via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 26 11:55:26 PST 2017


iteratee added inline comments.


================
Comment at: lib/CodeGen/IfConversion.cpp:647
+  // We have to do our own shifting so that we get the same range.
+  MachineBasicBlock::reverse_iterator RTIE = std::next(TIE.getReverse());
+  MachineBasicBlock::reverse_iterator RFIE = std::next(FIE.getReverse());
----------------
dblaikie wrote:
> This construct is used rather than this:
> 
>   MachineBasicBlock::reverse_iterator RTIE = TIE;
> 
> to avoid depending on that conversion & it's subtle off-by-one jump?
Currently, there is no such conversion in ilist_iterator, only a getReverse() method, that doesn't perform an off-by-one jump.


https://reviews.llvm.org/D27792





More information about the llvm-commits mailing list