aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2023-04-26 10:02:54 -0400
committerMatt Arsenault <arsenm2@gmail.com>2023-05-16 14:38:39 +0100
commit0ee2245ab2232e454151e5c9d1637cde4686ee9c (patch)
treeb5f44205bc29b416809b49bba528922e20960121 /llvm/lib/Analysis/ValueTracking.cpp
parent2dc435a59d565849ef62ae3c63dd4fc79a3e16f3 (diff)
downloadllvm-0ee2245ab2232e454151e5c9d1637cde4686ee9c.zip
llvm-0ee2245ab2232e454151e5c9d1637cde4686ee9c.tar.gz
llvm-0ee2245ab2232e454151e5c9d1637cde4686ee9c.tar.bz2
ValueTracking: Restore ordered negative handling for frem
In D148674, the negative condition was weakened to only checking isKnownNever(fcNegative), instead of cannotBeOrderedLessThanZero(). This avoids a regression when CannotBeOrderedLessThanZero is replaced with computeKnownFPClass.
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 5947a68..28b4fc4 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -5179,6 +5179,12 @@ void computeKnownFPClass(const Value *V, const APInt &DemandedElts,
}
// The sign for frem is the same as the first operand.
+ if (KnownLHS.cannotBeOrderedLessThanZero())
+ Known.knownNot(KnownFPClass::OrderedLessThanZeroMask);
+ if (KnownLHS.cannotBeOrderedGreaterThanZero())
+ Known.knownNot(KnownFPClass::OrderedGreaterThanZeroMask);
+
+ // See if we can be more aggressive about the sign of 0.
if (KnownLHS.isKnownNever(fcNegative))
Known.knownNot(fcNegative);
if (KnownLHS.isKnownNever(fcPositive))