[llvm] InstCombine] Fold fcmp eq over min/max-like select into compare on input (PR #188226)

Nathiyaa Sengodan via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 27 23:08:25 PDT 2026


Nathiyaa-Sengodan wrote:

> I'd like to decompose this transformation into two parts, each of which eliminates one min/max pattern. For example: https://alive2.llvm.org/ce/z/qDhMki
> 
> ```
> max(min(x, 5.0), 2.0) == 5.0 ->
> min(x, 5.0) == 5.0 ->
> x >= 5.0
> ```

Thanks. 
I have updated the PR, so that we decompose this into two parts, instead of folding the entire clamp pattern. 

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


More information about the llvm-commits mailing list