Skip to content

Commit b2cbe5c

Browse files
committed
cannotBeOrderedNegativeFP
1 parent b6bbf9c commit b2cbe5c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

llvm/include/llvm/CodeGen/SelectionDAG.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2115,9 +2115,9 @@ class SelectionDAG {
21152115
/// Test whether the given SDValue is known to contain non-zero value(s).
21162116
bool isKnownNeverZero(SDValue Op, unsigned Depth = 0) const;
21172117

2118-
/// Test whether the given float value is known to not be negative. 0.0 is
2119-
/// considered non-negative, -0.0 is considered negative.
2120-
bool isKnownNonNegativeFP(SDValue Op) const;
2118+
/// Test whether the given float value is known to be positive. +0.0, +inf and
2119+
/// +nan are considered positive, -0.0, -inf and -nan are not.
2120+
bool cannotBeOrderedNegativeFP(SDValue Op) const;
21212121

21222122
/// Test whether two SDValues are known to compare equal. This
21232123
/// is true if they are the same value, or if one is negative zero and the

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17384,7 +17384,7 @@ SDValue DAGCombiner::visitFREM(SDNode *N) {
1738417384
TLI.isOperationLegalOrCustom(ISD::FDIV, VT) &&
1738517385
TLI.isOperationLegalOrCustom(ISD::FTRUNC, VT) &&
1738617386
DAG.isKnownToBeAPowerOfTwoFP(N1) &&
17387-
(Flags.hasNoSignedZeros() || DAG.isKnownNonNegativeFP(N0))) {
17387+
(Flags.hasNoSignedZeros() || DAG.cannotBeOrderedNegativeFP(N0))) {
1738817388
SDValue Div = DAG.getNode(ISD::FDIV, DL, VT, N0, N1);
1738917389
SDValue Rnd = DAG.getNode(ISD::FTRUNC, DL, VT, Div);
1739017390
if (TLI.isFMAFasterThanFMulAndFAdd(DAG.getMachineFunction(), VT))

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5565,7 +5565,7 @@ bool SelectionDAG::isKnownNeverZero(SDValue Op, unsigned Depth) const {
55655565
return computeKnownBits(Op, Depth).isNonZero();
55665566
}
55675567

5568-
bool SelectionDAG::isKnownNonNegativeFP(SDValue Op) const {
5568+
bool SelectionDAG::cannotBeOrderedNegativeFP(SDValue Op) const {
55695569
if (ConstantFPSDNode *C1 = isConstOrConstSplatFP(Op, true))
55705570
return !C1->isNegative();
55715571

0 commit comments

Comments
 (0)