[llvm] [AArch64] Add SUBS(CSEL) fold from brcond. (PR #142103)

David Green via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 3 11:24:28 PDT 2025


davemgreen wrote:

> is csel(0, 1, CC, Cmp) canonicalized or changed to be 1, 0? Can we catch that too?

We do quite a lot of canonicalization of the IR and of the target independent setccs - it can be quite hard to test the different variations as they don't often come up. I haven't seen any other combos in real code (that were not from O0), either from the other variants of this or from csel of csel. I did manage to find a function that was helpful for handling some of the variants of cset.

Canonical csel might be a nice idea - it could help remove a few tablegen patterns. When I tried it it got stuck in an infinite loop though.

https://github.com/llvm/llvm-project/pull/142103


More information about the llvm-commits mailing list