2009-07-23 13:27:48 +08:00
|
|
|
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | FileCheck %s
|
2009-06-17 03:55:29 +08:00
|
|
|
|
|
|
|
; This turns into a&1 != 0
|
2009-07-23 13:27:48 +08:00
|
|
|
define <2 x i1> @test1(<2 x i64> %a) {
|
2009-06-17 03:55:29 +08:00
|
|
|
%t = trunc <2 x i64> %a to <2 x i1>
|
|
|
|
ret <2 x i1> %t
|
2009-07-23 13:27:48 +08:00
|
|
|
|
|
|
|
; CHECK: define <2 x i1> @test1
|
|
|
|
; CHECK: and <2 x i64> %a, <i64 1, i64 1>
|
|
|
|
; CHECK: icmp ne <2 x i64> %tmp, zeroinitializer
|
2009-06-17 03:55:29 +08:00
|
|
|
}
|
2009-07-23 13:27:48 +08:00
|
|
|
|
2009-06-17 03:55:29 +08:00
|
|
|
; The ashr turns into an lshr.
|
2009-07-23 13:27:48 +08:00
|
|
|
define <2 x i64> @test2(<2 x i64> %a) {
|
2009-06-17 03:55:29 +08:00
|
|
|
%b = and <2 x i64> %a, <i64 65535, i64 65535>
|
|
|
|
%t = ashr <2 x i64> %b, <i64 1, i64 1>
|
|
|
|
ret <2 x i64> %t
|
2009-07-23 13:27:48 +08:00
|
|
|
|
|
|
|
; CHECK: define <2 x i64> @test2
|
|
|
|
; CHECK: and <2 x i64> %a, <i64 65535, i64 65535>
|
|
|
|
; CHECK: lshr <2 x i64> %b, <i64 1, i64 1>
|
2009-06-17 03:55:29 +08:00
|
|
|
}
|