HomePhabricator

[InstSimplify] fold fcmp (minnum, X, C1), C2

Description

[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

Details

Committed
spatelMay 16 2019, 7:03 AM
Differential Revision
D61691: [InstSimplify] fold fcmp (minnum, X, C1), C2
Parents
rL360898: Fixes for builds that require strict X/Open and POSIX compatiblity
Branches
Unknown
Tags
Unknown