[PATCH] D39004: [ARM] Swap cmp operands for automatic shifts.
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 23 15:07:25 PDT 2017
efriedma added inline comments.
================
Comment at: lib/Target/ARM/ARMISelLowering.cpp:3869
+ if (SwapOperands) {
+ CondCode = ARMCC::getOppositeCondition(CondCode);
+ std::swap(LHS, RHS);
----------------
Wait a sec.
In IR, we have two related, but distinct methods on comparisons: getInversePredicate, and getSwappedPredicate. Similarly, in SelectionDAG we have getSetCCInverse and getSetCCSwappedOperands. ARMCC::getOppositeCondition is equivalent to getInversePredicate, but I think you want getSwappedPredicate here?
And given that oversight, I have to ask: how did you test this?
https://reviews.llvm.org/D39004
More information about the llvm-commits
mailing list