[PATCH] D148544: ValueTracking: Handle fptrunc_round in computeKnownFPClass

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 18 05:25:18 PDT 2023


foad added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:4078
+  KnownFPClass KnownSrc;
+  computeKnownFPClass(Op->getOperand(0), DemandedElts, InterestedClasses,
+                      KnownSrc, Depth + 1, Q, TLI);
----------------
arsenm wrote:
> foad wrote:
> > I think there might be subtle bugs lurking in the way you pass InterestedClasses into recursive calls. E.g if InterestedClasses was fcQNan here, and the recursive call returned fcNone, you would conclude the operand is not nan - but in reality it could still be snan.
> > 
> > If I'm right that that's a bug then you could fix this case by passing fcNan into the recursive call.
> > 
> > Anyway this is pre-existing.
> InterestedClasses shouldn't be an issue, it's only used for early exiting as it's a compile time hint. The nan propagation could be better, I started introducing a helper for this in D148599
OK, if we always return conservatively correct info the for the un-interested-classes then I guess there's no bug.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148544/new/

https://reviews.llvm.org/D148544



More information about the llvm-commits mailing list