[llvm] [AMDGPU] Fold compares of S_CSELECT of two different constants (PR #227772)

via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 13:46:50 PDT 2026


================

----------------
LU-JOHN wrote:

foldableSelect should be inlined.
The remaining use of foldableSelect only exploits:     
`//    sX = s_cselect_b64 (non-zero imm), 0`
It can be re-written to exploit:
`//    sX = s_cselect_b64 A, B`
where A!=B and one of A or B is 0.  It can reuse the `getSelectConstants` from this PR.

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


More information about the llvm-commits mailing list