[ValueTracking] Allow select patterns to work on FP vectors
authorThomas Lively <tlively@google.com>
Fri, 28 Sep 2018 21:36:43 +0000 (21:36 +0000)
committerThomas Lively <tlively@google.com>
Fri, 28 Sep 2018 21:36:43 +0000 (21:36 +0000)
commitd47b5c7bedf2c2439628c4ba7212c00db5f97854
tree44a3fe6c9d60bd25caa54e2f4d0af13b74a6a8fb
parente63a12ccbedbe29120dc6525651792117e1780f7
[ValueTracking] Allow select patterns to work on FP vectors

Summary:
This CL allows constant vectors of floats to be recognized as non-NaN
and non-zero in select patterns. This change makes
`matchSelectPattern` more powerful generally, but was motivated
specifically because I wanted fminnan and fmaxnan to be created for
vector versions of the scalar patterns they are created for.

Tested with check-all on all targets. A testcase in the WebAssembly
backend that tests the non-nan codepath is in an upcoming CL.

Reviewers: aheejin, dschuff

Subscribers: sunfish, llvm-commits

Differential Revision: https://reviews.llvm.org/D52324

llvm-svn: 343364
llvm/lib/Analysis/ValueTracking.cpp
llvm/unittests/Analysis/ValueTrackingTest.cpp