[PATCH] D149186: ValueTracking: Fix InterestedClasses logic for fadd/fsub

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 25 13:15:12 PDT 2023


arsenm created this revision.
arsenm added reviewers: jcranmer-intel, kpn, andrew.w.kaylor, foad.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
arsenm requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

This was early exiting for -0 queries.


https://reviews.llvm.org/D149186

Files:
  llvm/lib/Analysis/ValueTracking.cpp


Index: llvm/lib/Analysis/ValueTracking.cpp
===================================================================
--- llvm/lib/Analysis/ValueTracking.cpp
+++ llvm/lib/Analysis/ValueTracking.cpp
@@ -4616,8 +4616,9 @@
         Op->getOpcode() == Instruction::FAdd &&
         (InterestedClasses & (fcNegative & ~fcNegZero)) != fcNone;
     bool WantNaN = (InterestedClasses & fcNan) != fcNone;
+    bool WantNegZero = (InterestedClasses & fcNegZero) != fcNone;
 
-    if (!WantNaN && !WantNegative)
+    if (!WantNaN && !WantNegative && !WantNegZero)
       break;
 
     computeKnownFPClass(Op->getOperand(1), DemandedElts, fcNan | fcInf,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149186.516877.patch
Type: text/x-patch
Size: 635 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230425/decf3ff8/attachment.bin>


More information about the llvm-commits mailing list