Generalize a few more instcombines to be vector/scalar-independent.
[oota-llvm.git] / test / Transforms / InstCombine / vector-casts-1.ll
1 ; RUN: llvm-as < %s | opt -instcombine > %t
2 ; RUN: not grep trunc %t
3 ; RUN: not grep ashr %t
4
5 ; This turns into a&1 != 0
6 define <2 x i1> @a(<2 x i64> %a) {
7   %t = trunc <2 x i64> %a to <2 x i1>
8   ret <2 x i1> %t
9 }
10 ; The ashr turns into an lshr.
11 define <2 x i64> @b(<2 x i64> %a) {
12   %b = and <2 x i64> %a, <i64 65535, i64 65535>
13   %t = ashr <2 x i64> %b, <i64 1, i64 1>
14   ret <2 x i64> %t
15 }