[PATCH] D144614: [LegalizeTypes][RISCV] Add a special case to ExpandIntRes_UADDSUBO for (uaddo X, 1).

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 23 10:11:20 PST 2023


craig.topper added a comment.

In D144614#4147953 <https://reviews.llvm.org/D144614#4147953>, @reames wrote:

> Both this and the related patch for ADD seem like they could be covered by a single set of DAG combine rules.  Specifically:
> a + 1 < a ==> a + 1 == 0
> a - 1 > a ==> a + 1 == 0

I think there's a mistake there. I think this is correct.
a - 1 > a  ==> a==0

> (With the comparisons in the notation above being setcc nodes.)
>
> Would doing the more general form and removing the expansion specific bits be worthwhile?

I'm not sure it helps with this patch, the wide setcc gets split before DAG combine would see it. But it could replace the change I did to ExpandIntRes_ADDSUB and the code I put in TargetLowering::expandUADDSUBO a long time back.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144614/new/

https://reviews.llvm.org/D144614



More information about the llvm-commits mailing list