[llvm] [InstCombine] Match a new form of truncating saturation (PR #189703)

Graham Hunter via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 1 03:16:22 PDT 2026


huntergr-arm wrote:

This doesn't do too much for scalar codegen, but when run before vectorization results in some noticeable improvements: https://godbolt.org/z/ajvxPWhqr (AArch64 SVE) and https://godbolt.org/z/38YxYvsze (X86_64; AVX512 fares better in the unoptimized case, but still gets an improvement).

RISC-V already seems to have this, possibly as a DAG combine, so I could move it to that point if preferable. However, doing it earlier may allow the vectorizers to make better costing decisions.

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


More information about the llvm-commits mailing list