[LegalizeTypes][RISCV] Add a special case to ExpandIntRes_UADDSUBO for (uaddo X, 1).
On targets that lack ADDCARRY support we split a wide uaddo into an ADD and a SETCC that both need to be split. For (uaddo X, 1) we can observe that when the add overflows the result will be 0. We can emit (seteq (or Lo, Hi), 0) to detect this. This improves D142071. There is an alternative here. We could use either ~(lo(X) & hi(X)) == 0 or (lo(X) & hi(X)) == -1 before the addition. That would be closer to the code before D142071. Reviewed By: liaolucy Differential Revision: https://reviews.llvm.org/D144614
Loading
Please sign in to comment