[PATCH] D88573: [SelectionDAG] Add check for BUILD_VECTOR in isKnownNeverNaN

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 5 02:25:57 PDT 2020


foad accepted this revision.
foad added a comment.

LGTM apart from the nitpick about comments.



================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:4104
 
   // TODO: Handle vectors.
   // If the value is a constant, we can obviously see if it is a NaN or not.
----------------
foad wrote:
> It looks like you're adding new functionality, so update the comment in SelectionDAG.h to explain that this function now handles vectors and what the behaviour is?
s/bellow/below/, or you could just delete this comment.

I meant something in SelectionDAG.h like:
```
  /// Test whether the given SDValue **(or all elements of it, if it is a vector)** are known to never be NaN. If \p SNaN is
  /// true, returns if \p Op is known to never be a signaling NaN (it may still
  /// be a qNaN).
  bool isKnownNeverNaN(SDValue Op, bool SNaN = false, unsigned Depth = 0) const;
```
Just to say explicitly what the expected behaviour is for a vector.


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

https://reviews.llvm.org/D88573



More information about the llvm-commits mailing list