Skip to content

Commit 6a17929

Browse files
[LLVM][tests/Transforms/InstSimplify] Convert instances of ConstantExpr based splats to use splat().
This is mostly NFC but some output does change due to consistently inserting into poison rather than undef and using i64 as the index type for inserts.
1 parent fd07b8f commit 6a17929

File tree

7 files changed

+41
-41
lines changed

7 files changed

+41
-41
lines changed

Diff for: llvm/test/Transforms/InstSimplify/ConstProp/vscale-inseltpoison.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ define <vscale x 4 x i32> @sub_splat() {
4545
; CHECK-LABEL: @sub_splat(
4646
; CHECK-NEXT: ret <vscale x 4 x i32> shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> poison, i32 -16, i64 0), <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer)
4747
;
48-
%r = sub <vscale x 4 x i32> zeroinitializer, shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> undef, i32 16, i32 0), <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer)
48+
%r = sub <vscale x 4 x i32> zeroinitializer, splat (i32 16)
4949
ret <vscale x 4 x i32> %r
5050
}
5151

Diff for: llvm/test/Transforms/InstSimplify/ConstProp/vscale.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ define <vscale x 4 x i32> @sub_splat() {
4545
; CHECK-LABEL: @sub_splat(
4646
; CHECK-NEXT: ret <vscale x 4 x i32> shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> poison, i32 -16, i64 0), <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer)
4747
;
48-
%r = sub <vscale x 4 x i32> zeroinitializer, shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> undef, i32 16, i32 0), <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer)
48+
%r = sub <vscale x 4 x i32> zeroinitializer, splat (i32 16)
4949
ret <vscale x 4 x i32> %r
5050
}
5151

Diff for: llvm/test/Transforms/InstSimplify/cmp-vec-fast-path.ll

+26-26
Large diffs are not rendered by default.

Diff for: llvm/test/Transforms/InstSimplify/fp-nan.ll

+10-10
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ define <vscale x 1 x float> @fsub_nan_op1_scalable_vec_0(<vscale x 1 x float> %x
5353
; CHECK-LABEL: @fsub_nan_op1_scalable_vec_0(
5454
; CHECK-NEXT: ret <vscale x 1 x float> shufflevector (<vscale x 1 x float> insertelement (<vscale x 1 x float> poison, float 0x7FF9000000000000, i64 0), <vscale x 1 x float> poison, <vscale x 1 x i32> zeroinitializer)
5555
;
56-
%r = fsub <vscale x 1 x float> %x, shufflevector (<vscale x 1 x float> insertelement (<vscale x 1 x float> poison, float 0x7FF1000000000000, i64 0), <vscale x 1 x float> poison, <vscale x 1 x i32> zeroinitializer)
56+
%r = fsub <vscale x 1 x float> %x, splat (float 0x7FF1000000000000)
5757
ret <vscale x 1 x float> %r
5858
}
5959

6060
define <vscale x 1 x float> @fsub_nan_op1_scalable_vec_1(<vscale x 1 x float> %x) {
6161
; CHECK-LABEL: @fsub_nan_op1_scalable_vec_1(
6262
; CHECK-NEXT: ret <vscale x 1 x float> shufflevector (<vscale x 1 x float> insertelement (<vscale x 1 x float> poison, float 0xFFF9000000000000, i64 0), <vscale x 1 x float> poison, <vscale x 1 x i32> zeroinitializer)
6363
;
64-
%r = fsub <vscale x 1 x float> %x, shufflevector (<vscale x 1 x float> insertelement (<vscale x 1 x float> poison, float 0xFFF1000000000000, i64 0), <vscale x 1 x float> poison, <vscale x 1 x i32> zeroinitializer)
64+
%r = fsub <vscale x 1 x float> %x, splat (float 0xFFF1000000000000)
6565
ret <vscale x 1 x float> %r
6666
}
6767

@@ -87,15 +87,15 @@ define <vscale x 1 x double> @fmul_nan_op0_scalable_vec_0(<vscale x 1 x double>
8787
; CHECK-LABEL: @fmul_nan_op0_scalable_vec_0(
8888
; CHECK-NEXT: ret <vscale x 1 x double> shufflevector (<vscale x 1 x double> insertelement (<vscale x 1 x double> poison, double 0xFFF8000000000001, i64 0), <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer)
8989
;
90-
%r = fmul <vscale x 1 x double> shufflevector (<vscale x 1 x double> insertelement (<vscale x 1 x double> poison, double 0xFFF0000000000001, i64 0), <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer), %x
90+
%r = fmul <vscale x 1 x double> splat (double 0xFFF0000000000001), %x
9191
ret <vscale x 1 x double> %r
9292
}
9393

9494
define <vscale x 1 x double> @fmul_nan_op0_scalable_vec_1(<vscale x 1 x double> %x) {
9595
; CHECK-LABEL: @fmul_nan_op0_scalable_vec_1(
9696
; CHECK-NEXT: ret <vscale x 1 x double> shufflevector (<vscale x 1 x double> insertelement (<vscale x 1 x double> poison, double 0xFFF8DEADDEADDEAD, i64 0), <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer)
9797
;
98-
%r = fmul <vscale x 1 x double> shufflevector (<vscale x 1 x double> insertelement (<vscale x 1 x double> poison, double 0xFFF0DEADDEADDEAD, i64 0), <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer), %x
98+
%r = fmul <vscale x 1 x double> splat (double 0xFFF0DEADDEADDEAD), %x
9999
ret <vscale x 1 x double> %r
100100
}
101101

@@ -113,7 +113,7 @@ define <vscale x 1 x double> @fmul_nan_op1_scalable_vec(<vscale x 1 x double> %x
113113
; CHECK-LABEL: @fmul_nan_op1_scalable_vec(
114114
; CHECK-NEXT: ret <vscale x 1 x double> shufflevector (<vscale x 1 x double> insertelement (<vscale x 1 x double> poison, double 0x7FF8000000000000, i64 0), <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer)
115115
;
116-
%r = fmul <vscale x 1 x double> %x, shufflevector (<vscale x 1 x double> insertelement (<vscale x 1 x double> poison, double 0x7FF8000000000000, i64 0), <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer)
116+
%r = fmul <vscale x 1 x double> %x, splat (double 0x7FF8000000000000)
117117
ret <vscale x 1 x double> %r
118118
}
119119

@@ -131,7 +131,7 @@ define <vscale x 1 x double> @fdivl_nan_op0_scalable_vec(<vscale x 1 x double> %
131131
; CHECK-LABEL: @fdivl_nan_op0_scalable_vec(
132132
; CHECK-NEXT: ret <vscale x 1 x double> shufflevector (<vscale x 1 x double> insertelement (<vscale x 1 x double> poison, double 0xFFF800000000000F, i64 0), <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer)
133133
;
134-
%r = fdiv <vscale x 1 x double> shufflevector (<vscale x 1 x double> insertelement (<vscale x 1 x double> poison, double 0xFFF800000000000F, i64 0), <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer), %x
134+
%r = fdiv <vscale x 1 x double> splat (double 0xFFF800000000000F), %x
135135
ret <vscale x 1 x double> %r
136136
}
137137

@@ -149,7 +149,7 @@ define <vscale x 1 x half> @fdiv_nan_op1_scalable_vec(<vscale x 1 x half> %x) {
149149
; CHECK-LABEL: @fdiv_nan_op1_scalable_vec(
150150
; CHECK-NEXT: ret <vscale x 1 x half> shufflevector (<vscale x 1 x half> insertelement (<vscale x 1 x half> poison, half 0xH7FFF, i64 0), <vscale x 1 x half> poison, <vscale x 1 x i32> zeroinitializer)
151151
;
152-
%r = fdiv <vscale x 1 x half> %x, shufflevector (<vscale x 1 x half> insertelement (<vscale x 1 x half> poison, half 0xH7FFF, i64 0), <vscale x 1 x half> poison, <vscale x 1 x i32> zeroinitializer)
152+
%r = fdiv <vscale x 1 x half> %x, splat (half 0xH7FFF)
153153
ret <vscale x 1 x half> %r
154154
}
155155

@@ -221,7 +221,7 @@ define <vscale x 1 x double> @fneg_nan_2_scalable_vec() {
221221
; CHECK-LABEL: @fneg_nan_2_scalable_vec(
222222
; CHECK-NEXT: ret <vscale x 1 x double> shufflevector (<vscale x 1 x double> insertelement (<vscale x 1 x double> poison, double 0xFFF9234567890ABC, i64 0), <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer)
223223
;
224-
%r = fsub <vscale x 1 x double> shufflevector (<vscale x 1 x double> insertelement (<vscale x 1 x double> poison, double -0.0, i64 0), <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer), shufflevector (<vscale x 1 x double> insertelement (<vscale x 1 x double> poison, double 0xFFF1234567890ABC, i64 0), <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer)
224+
%r = fsub <vscale x 1 x double> splat (double -0.0), splat (double 0xFFF1234567890ABC)
225225
ret <vscale x 1 x double> %r
226226
}
227227

@@ -239,7 +239,7 @@ define <vscale x 1 x double> @unary_fneg_nan_2_scalable_vec_0() {
239239
; CHECK-NEXT: [[R:%.*]] = fneg <vscale x 1 x double> shufflevector (<vscale x 1 x double> insertelement (<vscale x 1 x double> poison, double 0xFFF1234567890ABC, i64 0), <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer)
240240
; CHECK-NEXT: ret <vscale x 1 x double> [[R]]
241241
;
242-
%r = fneg <vscale x 1 x double> shufflevector (<vscale x 1 x double> insertelement (<vscale x 1 x double> poison, double 0xFFF1234567890ABC, i64 0), <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer)
242+
%r = fneg <vscale x 1 x double> splat (double 0xFFF1234567890ABC)
243243
ret <vscale x 1 x double> %r
244244
}
245245

@@ -249,7 +249,7 @@ define <vscale x 1 x double> @unary_fneg_nan_2_scalable_vec_1() {
249249
; CHECK-NEXT: [[R:%.*]] = fneg <vscale x 1 x double> shufflevector (<vscale x 1 x double> insertelement (<vscale x 1 x double> poison, double 0x7FF0000000000001, i64 0), <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer)
250250
; CHECK-NEXT: ret <vscale x 1 x double> [[R]]
251251
;
252-
%r = fneg <vscale x 1 x double> shufflevector (<vscale x 1 x double> insertelement (<vscale x 1 x double> poison, double 0x7FF0000000000001, i64 0), <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer)
252+
%r = fneg <vscale x 1 x double> splat (double 0x7FF0000000000001)
253253
ret <vscale x 1 x double> %r
254254
}
255255

Diff for: llvm/test/Transforms/InstSimplify/shift.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ define <vscale x 4 x i16> @lshr_scalable_overshift(<vscale x 4 x i16> %va) {
347347
; CHECK-LABEL: @lshr_scalable_overshift(
348348
; CHECK-NEXT: ret <vscale x 4 x i16> poison
349349
;
350-
%vc = lshr <vscale x 4 x i16> %va, shufflevector (<vscale x 4 x i16> insertelement (<vscale x 4 x i16> poison, i16 16, i32 0), <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer)
350+
%vc = lshr <vscale x 4 x i16> %va, splat (i16 16)
351351
ret <vscale x 4 x i16> %vc
352352
}
353353

Diff for: llvm/test/Transforms/InstSimplify/vscale-inseltpoison.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ define <vscale x 2 x i1> @cmp_le_smax_always_true(<vscale x 2 x i64> %x) {
134134
; CHECK-LABEL: @cmp_le_smax_always_true(
135135
; CHECK-NEXT: ret <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> poison, i1 true, i64 0), <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer)
136136
;
137-
%cmp = icmp sle <vscale x 2 x i64> %x, shufflevector (<vscale x 2 x i64> insertelement (<vscale x 2 x i64> poison, i64 9223372036854775807, i32 0), <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer)
137+
%cmp = icmp sle <vscale x 2 x i64> %x, splat (i64 9223372036854775807)
138138
ret <vscale x 2 x i1> %cmp
139139
}
140140

Diff for: llvm/test/Transforms/InstSimplify/vscale.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ define <vscale x 2 x i1> @cmp_le_smax_always_true(<vscale x 2 x i64> %x) {
146146
; CHECK-LABEL: @cmp_le_smax_always_true(
147147
; CHECK-NEXT: ret <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> poison, i1 true, i64 0), <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer)
148148
;
149-
%cmp = icmp sle <vscale x 2 x i64> %x, shufflevector (<vscale x 2 x i64> insertelement (<vscale x 2 x i64> poison, i64 9223372036854775807, i32 0), <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer)
149+
%cmp = icmp sle <vscale x 2 x i64> %x, splat (i64 9223372036854775807)
150150
ret <vscale x 2 x i1> %cmp
151151
}
152152

0 commit comments

Comments
 (0)