[llvm] [ValueTracking] Handle and/or of conditions in `computeKnownFPClassFromContext` (PR #118257)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 2 00:32:40 PST 2024


================
@@ -4885,6 +4885,13 @@ static void computeKnownFPClassFromCond(const Value *V, Value *Cond,
                                         bool CondIsTrue,
                                         const Instruction *CxtI,
                                         KnownFPClass &KnownFromContext) {
+  Value *A, *B;
+  if (CondIsTrue ? match(Cond, m_LogicalAnd(m_Value(A), m_Value(B)))
+                 : match(Cond, m_LogicalOr(m_Value(A), m_Value(B)))) {
+    computeKnownFPClassFromCond(V, A, CondIsTrue, CxtI, KnownFromContext);
+    computeKnownFPClassFromCond(V, B, CondIsTrue, CxtI, KnownFromContext);
+    return;
+  }
----------------
nikic wrote:

Should we increase Depth here like in computeKnownBitsFromCond?

https://github.com/llvm/llvm-project/pull/118257


More information about the llvm-commits mailing list