]> granicus.if.org Git - llvm/commit
[InstSimplify] fold fcmp (minnum, X, C1), C2
authorSanjay Patel <spatel@rotateright.com>
Thu, 16 May 2019 14:03:10 +0000 (14:03 +0000)
committerSanjay Patel <spatel@rotateright.com>
Thu, 16 May 2019 14:03:10 +0000 (14:03 +0000)
commit90a7bd7e82703a62ec7b54a817ca6f4fde080e8d
tree5a0f1cdab182e4953551164241848b2d2eab8de0
parent1b057e5bee292a7797d5cfc41deeddb99556a75e
[InstSimplify] fold fcmp (minnum, X, C1), C2
   minnum(X, LesserC) == C --> false
   minnum(X, LesserC) >= C --> false
   minnum(X, LesserC) >  C --> false
   minnum(X, LesserC) != C --> true
   minnum(X, LesserC) <= C --> true
   minnum(X, LesserC) <  C --> true

maxnum siblings will follow if there are no problems here.

We should be able to perform some other combines when the constants
are equal or greater-than too, but that would go in instcombine.

We might also generalize this by creating an FP ConstantRange
(similar to what we do for integers).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360899 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/InstructionSimplify.cpp
test/Transforms/InstSimplify/floating-point-compare.ll