[llvm] [Instcombine]: `llvm.ucmp` and `llvm.scmp` recognition (PR #168505)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 21 08:45:41 PST 2025
https://github.com/dtcxzyw commented:
For the first pattern, s/ucmp is less profitable than select + icmp because the former one needs two icmp + two selects/one sub (See also `TargetLowering::expandCMP`). It doesn't simplify the IR since X and Y still have two uses after the transformation.
For the second pattern `select(icmp(eq, X, Y), 0, llvm.cmp(X, Y)) -> llvm.cmp(X, Y)`, absorbing the equality test into s/ucmp is interesting. Unfortunately we haven't seen its existence in real-world programs.
https://github.com/llvm/llvm-project/pull/168505
More information about the llvm-commits
mailing list