2011-02-13 15:45:34 +00:00
|
|
|
; RUN: opt < %s -instcombine -S | FileCheck %s
|
2011-02-11 19:37:55 +00:00
|
|
|
|
2013-07-14 01:42:54 +00:00
|
|
|
; CHECK-LABEL: @a(
|
2011-02-13 15:45:34 +00:00
|
|
|
; CHECK-NOT: bitcast
|
|
|
|
; CHECK: ret
|
2011-02-11 19:37:55 +00:00
|
|
|
define <4 x i32> @a(<1 x i64> %y) {
|
|
|
|
%c = bitcast <2 x i64> <i64 0, i64 0> to <4 x i32>
|
|
|
|
ret <4 x i32> %c
|
|
|
|
}
|
|
|
|
|
2013-07-14 01:42:54 +00:00
|
|
|
; CHECK-LABEL: @b(
|
2011-02-13 16:13:16 +00:00
|
|
|
; CHECK-NOT: bitcast
|
2011-02-13 15:45:34 +00:00
|
|
|
; CHECK: ret
|
|
|
|
|
2011-02-11 19:37:55 +00:00
|
|
|
define <4 x i32> @b(<1 x i64> %y) {
|
|
|
|
%c = bitcast <2 x i64> <i64 -1, i64 -1> to <4 x i32>
|
|
|
|
ret <4 x i32> %c
|
|
|
|
}
|
|
|
|
|
2013-07-14 01:42:54 +00:00
|
|
|
; CHECK-LABEL: @foo(
|
2011-02-17 21:22:27 +00:00
|
|
|
; CHECK-NOT: bitcast
|
|
|
|
; CHECK: ret
|
2011-02-13 15:45:34 +00:00
|
|
|
|
|
|
|
; from MultiSource/Benchmarks/Bullet
|
|
|
|
define <2 x float> @foo() {
|
|
|
|
%cast = bitcast i64 -1 to <2 x float>
|
|
|
|
ret <2 x float> %cast
|
|
|
|
}
|
|
|
|
|
2011-02-11 19:37:55 +00:00
|
|
|
|
2013-07-14 01:42:54 +00:00
|
|
|
; CHECK-LABEL: @foo2(
|
2011-02-17 21:22:27 +00:00
|
|
|
; CHECK-NOT: bitcast
|
|
|
|
; CHECK: ret
|
|
|
|
define <2 x double> @foo2() {
|
|
|
|
%cast = bitcast i128 -1 to <2 x double>
|
|
|
|
ret <2 x double> %cast
|
|
|
|
}
|
2011-02-11 19:37:55 +00:00
|
|
|
|
2013-07-14 01:42:54 +00:00
|
|
|
; CHECK-LABEL: @foo3(
|
2011-02-17 21:22:27 +00:00
|
|
|
; CHECK-NOT: bitcast
|
|
|
|
; CHECK: ret
|
|
|
|
define <1 x float> @foo3() {
|
|
|
|
%cast = bitcast i32 -1 to <1 x float>
|
|
|
|
ret <1 x float> %cast
|
|
|
|
}
|
|
|
|
|
2013-07-14 01:42:54 +00:00
|
|
|
; CHECK-LABEL: @foo4(
|
2011-02-17 21:22:27 +00:00
|
|
|
; CHECK-NOT: bitcast
|
|
|
|
; CHECK: ret
|
|
|
|
define float @foo4() {
|
|
|
|
%cast = bitcast <1 x i32 ><i32 -1> to float
|
|
|
|
ret float %cast
|
|
|
|
}
|
|
|
|
|
2013-07-14 01:42:54 +00:00
|
|
|
; CHECK-LABEL: @foo5(
|
2011-02-17 21:22:27 +00:00
|
|
|
; CHECK-NOT: bitcast
|
|
|
|
; CHECK: ret
|
|
|
|
define double @foo5() {
|
|
|
|
%cast = bitcast <2 x i32 ><i32 -1, i32 -1> to double
|
|
|
|
ret double %cast
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-07-14 01:42:54 +00:00
|
|
|
; CHECK-LABEL: @foo6(
|
2011-02-17 21:22:27 +00:00
|
|
|
; CHECK-NOT: bitcast
|
|
|
|
; CHECK: ret
|
|
|
|
define <2 x double> @foo6() {
|
|
|
|
%cast = bitcast <4 x i32><i32 -1, i32 -1, i32 -1, i32 -1> to <2 x double>
|
|
|
|
ret <2 x double> %cast
|
|
|
|
}
|