[PATCH] D123781: [AArch64] Add `foldADCToCINC` DAG combine

Karl Meakin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 27 09:26:19 PDT 2022


Kmeakin added a comment.

In D123781#3475209 <https://reviews.llvm.org/D123781#3475209>, @paulwalker-arm wrote:

> It's not immediately clear to me what the advantage is to using `CINC` verses `ADC`.  Sure some of the tests emit less code but for those cases it just looks like we're not making good use of `xzr`?

It's true that both instructions have the same throughput and latency (on all the microarchitecures I could find the optimisation guides for), but I would argue that `CSINC` is a more natural/canonical way of representing this operation than `ADC`, which could make it easier for future optimisations to recognise it.

I'm not sure why `ADC` requires an extra `MOV`: maybe the register allocation could so with improvement?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123781



More information about the llvm-commits mailing list