Swap the compare operands if the lhs is a shift and the rhs isn't, as in arm and T2 the shift can be performed by the compare for its second operand.
Details
Diff Detail
Event Timeline
By "combine", I meant we should end up with one file, run in both ARM and Thumb mode; duplicating the tests just makes it more confusing.
lib/Target/ARM/ARMISelLowering.cpp | ||
---|---|---|
3869 | 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? |
lib/Target/ARM/ARMISelLowering.cpp | ||
---|---|---|
3869 | Very badly it seems. Thanks for catching this and sorry for making the dumb mistake. I'll use the SwappedOperands function and add some vital checks to the tests. Thanks again. |
Now using getSetCCSwappedOperands to fix the condition code issue. Also added checks to the tests to inspect the condition codes used.
Whitespace.