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

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 24 20:04:44 PDT 2018


xbolva00 added inline comments.


================
Comment at: lib/Analysis/ValueTracking.cpp:4427
+  }
+
   return false;
----------------
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..?




Repository:
  rL LLVM

https://reviews.llvm.org/D52324





More information about the llvm-commits mailing list