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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes='instcombine' -S %s | FileCheck %s
define <4 x double> @shuffle_op0_freeze_poison(<2 x double> %a) {
; CHECK-LABEL: @shuffle_op0_freeze_poison(
; CHECK-NEXT: [[B:%.*]] = freeze <2 x double> poison
; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <2 x double> [[B]], <2 x double> [[A:%.*]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>
; CHECK-NEXT: ret <4 x double> [[SHUFFLE]]
;
%b = freeze <2 x double> poison
%shuffle = shufflevector <2 x double> %b, <2 x double> %a, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
ret <4 x double> %shuffle
}
define <4 x double> @shuffle_op1_freeze_poison(<2 x double> %a) {
; CHECK-LABEL: @shuffle_op1_freeze_poison(
; CHECK-NEXT: [[B:%.*]] = freeze <2 x double> poison
; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <2 x double> [[A:%.*]], <2 x double> [[B]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>
; CHECK-NEXT: ret <4 x double> [[SHUFFLE]]
;
%b = freeze <2 x double> poison
%shuffle = shufflevector <2 x double> %a, <2 x double> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
ret <4 x double> %shuffle
}
define <4 x double> @shuffle_op0_freeze_poison_use(<2 x double> %a) {
; CHECK-LABEL: @shuffle_op0_freeze_poison_use(
; CHECK-NEXT: [[B:%.*]] = freeze <2 x double> poison
; CHECK-NEXT: call void @use(<2 x double> [[B]])
; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <2 x double> [[B]], <2 x double> [[A:%.*]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>
; CHECK-NEXT: ret <4 x double> [[SHUFFLE]]
;
%b = freeze <2 x double> poison
call void @use(<2 x double> %b)
%shuffle = shufflevector <2 x double> %b, <2 x double> %a, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
ret <4 x double> %shuffle
}
define <4 x double> @shuffle_op1_freeze_poison_use(<2 x double> %a) {
; CHECK-LABEL: @shuffle_op1_freeze_poison_use(
; CHECK-NEXT: [[B:%.*]] = freeze <2 x double> poison
; CHECK-NEXT: call void @use(<2 x double> [[B]])
; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <2 x double> [[A:%.*]], <2 x double> [[B]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>
; CHECK-NEXT: ret <4 x double> [[SHUFFLE]]
;
%b = freeze <2 x double> poison
call void @use(<2 x double> %b)
%shuffle = shufflevector <2 x double> %a, <2 x double> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
ret <4 x double> %shuffle
}
define <4 x double> @shuffle_op0_freeze_undef(<2 x double> %a) {
; CHECK-LABEL: @shuffle_op0_freeze_undef(
; CHECK-NEXT: [[B:%.*]] = freeze <2 x double> undef
; CHECK-NEXT: call void @use(<2 x double> [[B]])
; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <2 x double> [[B]], <2 x double> [[A:%.*]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>
; CHECK-NEXT: ret <4 x double> [[SHUFFLE]]
;
%b = freeze <2 x double> undef
call void @use(<2 x double> %b)
%shuffle = shufflevector <2 x double> %b, <2 x double> %a, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
ret <4 x double> %shuffle
}
define <4 x double> @shuffle_op1_freeze_undef(<2 x double> %a) {
; CHECK-LABEL: @shuffle_op1_freeze_undef(
; CHECK-NEXT: [[B:%.*]] = freeze <2 x double> undef
; CHECK-NEXT: call void @use(<2 x double> [[B]])
; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <2 x double> [[A:%.*]], <2 x double> [[B]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>
; CHECK-NEXT: ret <4 x double> [[SHUFFLE]]
;
%b = freeze <2 x double> undef
call void @use(<2 x double> %b)
%shuffle = shufflevector <2 x double> %a, <2 x double> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
ret <4 x double> %shuffle
}
define <4 x double> @shuffle_bc1(<2 x double> %a) {
; CHECK-LABEL: @shuffle_bc1(
; CHECK-NEXT: [[B:%.*]] = freeze <4 x float> poison
; CHECK-NEXT: [[B1:%.*]] = bitcast <4 x float> [[B]] to <2 x double>
; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <2 x double> [[A:%.*]], <2 x double> [[B1]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>
; CHECK-NEXT: ret <4 x double> [[SHUFFLE]]
;
%b = freeze <4 x float> poison
%b1 = bitcast <4 x float> %b to <2 x double>
%shuffle = shufflevector <2 x double> %a, <2 x double> %b1, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
ret <4 x double> %shuffle
}
define <8 x float> @shuffle_bc2(<4 x float> %a) {
; CHECK-LABEL: @shuffle_bc2(
; CHECK-NEXT: [[B:%.*]] = freeze <4 x float> poison
; CHECK-NEXT: [[B1:%.*]] = bitcast <4 x float> [[B]] to <2 x double>
; CHECK-NEXT: call void @use(<2 x double> [[B1]])
; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x float> [[A:%.*]], <4 x float> [[B]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
; CHECK-NEXT: ret <8 x float> [[SHUFFLE]]
;
%b = freeze <4 x float> poison
%b1 = bitcast <4 x float> %b to <2 x double>
call void @use(<2 x double> %b1)
%b2 = bitcast <2 x double> %b1 to <4 x float>
%shuffle = shufflevector <4 x float> %a, <4 x float> %b2, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
ret <8 x float> %shuffle
}
declare void @use(<2 x double>)
|