[PATCH] D42312: [ARM] Cleanup part of ARMBaseInstrInfo::optimizeCompareInstr (NFCI).

Joel Galenson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 13:12:21 PST 2018


jgalenson added inline comments.


================
Comment at: lib/Target/ARM/ARMBaseInstrInfo.cpp:2754
+    if ((Instr.modifiesRegister(ARM::CPSR, TRI) ||
+         Instr.readsRegister(ARM::CPSR, TRI)) && I != E)
       // This instruction modifies or uses CPSR after the one we want to
----------------
efriedma wrote:
> Maybe it would be more clear to write "if (I == E) break;" before this check?
Sure, I can do that, but it does re-introduce an early exit into the loop, which I remember you didn't like before.

This, by the way, is exactly why I considered splitting this into two loops, which is another possibility, although it seemed a bit more complicated (and less efficient) to me.


https://reviews.llvm.org/D42312





More information about the llvm-commits mailing list