summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/bitcast-vec-uniform.ll
blob: bfb77191a75f36dd100ade1a85a567ad51cb30ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
; RUN: opt < %s -instcombine -S | FileCheck %s

; CHECK-LABEL: @a(
; CHECK-NOT: bitcast
; CHECK: ret
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
}

; CHECK-LABEL: @b(
; CHECK-NOT: bitcast
; CHECK: ret

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
}

; CHECK-LABEL: @foo(
; CHECK-NOT: bitcast
; CHECK: ret

; from MultiSource/Benchmarks/Bullet
define <2 x float> @foo() {
  %cast = bitcast i64 -1 to <2 x float>
  ret <2 x float> %cast
}


; CHECK-LABEL: @foo2(
; CHECK-NOT: bitcast
; CHECK: ret
define <2 x double> @foo2() {
  %cast = bitcast i128 -1 to <2 x double>
  ret <2 x double> %cast
}

; CHECK-LABEL: @foo3(
; CHECK-NOT: bitcast
; CHECK: ret
define <1 x float> @foo3() {
  %cast = bitcast i32 -1 to <1 x float>
  ret <1 x float> %cast
}

; CHECK-LABEL: @foo4(
; CHECK-NOT: bitcast
; CHECK: ret
define float @foo4() {
  %cast = bitcast <1 x i32 ><i32 -1> to float
  ret float %cast
}

; CHECK-LABEL: @foo5(
; CHECK-NOT: bitcast
; CHECK: ret
define double @foo5() {
  %cast = bitcast <2 x i32 ><i32 -1, i32 -1> to double
  ret double %cast
}


; CHECK-LABEL: @foo6(
; 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
}