[PATCH] D116915: [DAGCombiner][AArch64] Enhance to support for scalar CSINC

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 21 09:57:23 PST 2022


dmgreen added a comment.

Thanks. And the CopyFromReg? This is currently converting `add(csel(C, 1, cc), CopyFromReg(x))` into `csinc(add(x, C), x)`. I'm not sure why it would be limited to a CopyFromReg. I would expect to convert any `add(csel(C, 1, cc), y)` (or `add(y, csel(C, 1, cc))` as add is commutative).

In order to be profitable this seems to also be relying on the fact that the add(x, C) will turn into an ADDri, which wouldn't be true for all constants. It might be neutral for larger constants? It's probably worth adding a test or two.


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

https://reviews.llvm.org/D116915



More information about the llvm-commits mailing list