Make some existing optimizations that would only trigger on scalars
authorChris Lattner <sabre@nondot.org>
Thu, 23 Jul 2009 05:32:17 +0000 (05:32 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 23 Jul 2009 05:32:17 +0000 (05:32 +0000)
commitf98d253bc5c64b6e79b9e9d3942bae41c30eb656
tree78bc19332e765bb71e2d05e1d7c62dd464e602d0
parente5f6bfffe7d72e4682fb6e5823776f1c7afc8c13
Make some existing optimizations that would only trigger on scalars
also apply to vectors.  This allows us to compile this:

#include <emmintrin.h>
__m128i a(__m128 a, __m128 b) { return a==a & b==b; }
__m128i b(__m128 a, __m128 b) { return a!=a | b!=b; }

to:

_a:
cmpordps %xmm1, %xmm0
ret
_b:
cmpunordps %xmm1, %xmm0
ret

with clang instead of to a ton of horrible code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76863 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/InstructionCombining.cpp
test/Transforms/InstCombine/vector-casts.ll