Details
- Reviewers
paulwalker-arm - Commits
- rG0298cce257f8: [AArch64] Add `foldADCToCINC` DAG combine.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
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?
Fair enough, but then in D124464 you use getNodeIfExists to see if there's an existing ADC to use in place of ADCS which depending on the ordering of combines might mean we don't find a candidate because it's been converted to CINC. That said, perhaps this isn't a realistic issue and it means we avoid the poor xzr usage issue so LGTM.