OSDN Git Service

[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)
commit0c13ef20a578b885418d5faabcb12885dc3fbfcd
tree0a3dfba44c4401ccdd9f1956c761b994dbad315e
parent3228596b4caa43c55d9d8d57dc604004cf04783a
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364721 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineSelect.cpp
test/Transforms/InstCombine/minmax-fp.ll