[InstCombine] canonicalize fcmp+select to minnum/maxnum intrinsics
authorSanjay Patel <spatel@rotateright.com>
Sun, 30 Jun 2019 13:40:31 +0000 (13:40 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sun, 30 Jun 2019 13:40:31 +0000 (13:40 +0000)
commit706b48251f6a30cf03185c34d93e907ba1e05de2
treec238cbd413571229b2239c3c373f15a2b5e979e1
parent78ee2fbf984b84db814bf7b3a68e2317e32b1a24
[InstCombine] canonicalize fcmp+select to minnum/maxnum intrinsics

This is the opposite direction of D62158 (we have to choose 1 form or the other).
Now that we have FMF on the select, this becomes more palatable. And the benefits
of having a single IR instruction for this operation (less chances of missing folds
based on extra uses, etc) overcome my previous comments about the potential advantage
of larger pattern matching/analysis.

Differential Revision: https://reviews.llvm.org/D62414

llvm-svn: 364721
llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
llvm/test/Transforms/InstCombine/minmax-fp.ll