@@ -108,10 +108,15 @@ ConstantFPRange ConstantFPRange::getNonNaN(const fltSemantics &Sem) {
108
108
/* MayBeQNaN=*/ false , /* MayBeSNaN=*/ false );
109
109
}
110
110
111
+ // / Return true for ULT/UGT/OLT/OGT
112
+ static bool fcmpPredExcludesEqual (FCmpInst::Predicate Pred) {
113
+ return !(Pred & FCmpInst::FCMP_OEQ);
114
+ }
115
+
111
116
// / Return [-inf, V) or [-inf, V]
112
117
static ConstantFPRange makeLessThan (APFloat V, FCmpInst::Predicate Pred) {
113
118
const fltSemantics &Sem = V.getSemantics ();
114
- if (FCmpInst::isFalseWhenEqual ( FCmpInst::getOrderedPredicate ( Pred) )) {
119
+ if (fcmpPredExcludesEqual ( Pred)) {
115
120
if (V.isNegInfinity ())
116
121
return ConstantFPRange::getEmpty (Sem);
117
122
V.next (/* nextDown=*/ true );
@@ -123,7 +128,7 @@ static ConstantFPRange makeLessThan(APFloat V, FCmpInst::Predicate Pred) {
123
128
// / Return (V, +inf] or [V, +inf]
124
129
static ConstantFPRange makeGreaterThan (APFloat V, FCmpInst::Predicate Pred) {
125
130
const fltSemantics &Sem = V.getSemantics ();
126
- if (FCmpInst::isFalseWhenEqual ( FCmpInst::getOrderedPredicate ( Pred) )) {
131
+ if (fcmpPredExcludesEqual ( Pred)) {
127
132
if (V.isPosInfinity ())
128
133
return ConstantFPRange::getEmpty (Sem);
129
134
V.next (/* nextDown=*/ false );
@@ -135,7 +140,7 @@ static ConstantFPRange makeGreaterThan(APFloat V, FCmpInst::Predicate Pred) {
135
140
// / Make sure that +0/-0 are both included in the range.
136
141
static ConstantFPRange extendZeroIfEqual (const ConstantFPRange &CR,
137
142
FCmpInst::Predicate Pred) {
138
- if (FCmpInst::isFalseWhenEqual ( FCmpInst::getOrderedPredicate ( Pred) ))
143
+ if (fcmpPredExcludesEqual ( Pred))
139
144
return CR;
140
145
141
146
APFloat Lower = CR.getLower ();
0 commit comments