[PATCH] D52324: [ValueTracking] Allow select patterns to work on vectors in more places

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 25 13:48:09 PDT 2018


aheejin added inline comments.


================
Comment at: lib/Analysis/ValueTracking.cpp:4427
+  }
+
   return false;
----------------
xbolva00 wrote:
> tlively wrote:
> > aheejin wrote:
> > > It looks like these are now repeating functionality of [[ https://github.com/llvm-mirror/llvm/blob/78f1b6d15e1a256882da9c59855ca29ce13156a3/lib/IR/Constants.cpp#L244-L255 | `Constant::isNaN` ]] and [[ https://github.com/llvm-mirror/llvm/blob/78f1b6d15e1a256882da9c59855ca29ce13156a3/lib/IR/Constants.cpp#L63-L83 |  `Constant::isZeroValue` ]]. Can we use them instead?
> > Not quite. `Constant::isNaN` and `Constant::isZeroValue` can detect whether *all* or *not all* of the vector elements are NaN or zero. Here we want to detect if *any* or *not any* of the elements are NaN or zero.
> Can we extract this code to a helper function somewhere to Constant or so..?
> 
> 
Why is the definition of non-NaN different from `!isNaN()`?


Repository:
  rL LLVM

https://reviews.llvm.org/D52324





More information about the llvm-commits mailing list