[llvm] ValueTracking: Account for undef in adjustKnownFPClassForSelectArm (PR #175372)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 12 08:40:50 PST 2026


================
@@ -4872,11 +4872,16 @@ void llvm::adjustKnownFPClassForSelectArm(KnownFPClass &Known, Value *Cond,
                                           Value *Arm, bool Invert,
                                           const SimplifyQuery &SQ,
                                           unsigned Depth) {
+
+  KnownFPClass KnownSrc;
   computeKnownFPClassFromCond(Arm, Cond,
-                              /*CondIsTrue=*/!Invert, SQ.CxtI, Known,
+                              /*CondIsTrue=*/!Invert, SQ.CxtI, KnownSrc,
                               Depth + 1);
-  // TODO: Do we need to check isGuaranteedNotToBeUndef, like the KnownBits
-  // case?
+  if (KnownSrc.isUnknown())
+    return;
+
+  if (isGuaranteedNotToBeUndef(Arm, SQ.AC, SQ.CxtI, SQ.DT, Depth + 1))
+    Known = KnownSrc;
----------------
arsenm wrote:

No, it was already adjusted in 80296b618e648ef56ea5e5bbf1b34be6b1b72dcf. I did this the same way as the known-bits case, this just removes the divergence in undef handling 

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


More information about the llvm-commits mailing list