Skip to content

Commit 58ec867

Browse files
committed
[InstSimplify] add more tests for freeze(constant); NFC
These should really be moved over to a ConstantFolding test file, but since this may overlap with the in-progress D76010 and similar tests already exist here, we can do that as a later cleanup.
1 parent b91905a commit 58ec867

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

llvm/test/Transforms/InstSimplify/freeze.ll

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,24 @@ define <2 x i32> @constvector() {
6565
ret <2 x i32> %x
6666
}
6767

68+
define <3 x i5> @constvector_weird() {
69+
; CHECK-LABEL: @constvector_weird(
70+
; CHECK-NEXT: [[X:%.*]] = freeze <3 x i5> <i5 0, i5 1, i5 10>
71+
; CHECK-NEXT: ret <3 x i5> [[X]]
72+
;
73+
%x = freeze <3 x i5> <i5 0, i5 1, i5 42>
74+
ret <3 x i5> %x
75+
}
76+
77+
define <2 x float> @constvector_FP() {
78+
; CHECK-LABEL: @constvector_FP(
79+
; CHECK-NEXT: [[X:%.*]] = freeze <2 x float> <float 0.000000e+00, float 1.000000e+00>
80+
; CHECK-NEXT: ret <2 x float> [[X]]
81+
;
82+
%x = freeze <2 x float> <float 0.0, float 1.0>
83+
ret <2 x float> %x
84+
}
85+
6886
define <2 x i32> @constvector_noopt() {
6987
; CHECK-LABEL: @constvector_noopt(
7088
; CHECK-NEXT: [[X:%.*]] = freeze <2 x i32> <i32 0, i32 undef>
@@ -74,6 +92,24 @@ define <2 x i32> @constvector_noopt() {
7492
ret <2 x i32> %x
7593
}
7694

95+
define <3 x i5> @constvector_weird_noopt() {
96+
; CHECK-LABEL: @constvector_weird_noopt(
97+
; CHECK-NEXT: [[X:%.*]] = freeze <3 x i5> <i5 0, i5 undef, i5 10>
98+
; CHECK-NEXT: ret <3 x i5> [[X]]
99+
;
100+
%x = freeze <3 x i5> <i5 0, i5 undef, i5 42>
101+
ret <3 x i5> %x
102+
}
103+
104+
define <2 x float> @constvector_FP_noopt() {
105+
; CHECK-LABEL: @constvector_FP_noopt(
106+
; CHECK-NEXT: [[X:%.*]] = freeze <2 x float> <float 0.000000e+00, float undef>
107+
; CHECK-NEXT: ret <2 x float> [[X]]
108+
;
109+
%x = freeze <2 x float> <float 0.0, float undef>
110+
ret <2 x float> %x
111+
}
112+
77113
define void @alloca() {
78114
; CHECK-LABEL: @alloca(
79115
; CHECK-NEXT: [[P:%.*]] = alloca i8

0 commit comments

Comments
 (0)