Skip to content

Commit eae26b6

Browse files
[IRBuilder] Use canonical i64 type for insertelement index used by vector splats.
Instcombine prefers this canonical form (see getPreferredVectorIndex), as does IRBuilder when passing the index as an integer so we may as well use the prefered form from creation. NOTE: All test changes are mechanical with nothing else expected beyond a change of index type from i32 to i64. Differential Revision: https://reviews.llvm.org/D140983
1 parent 4313b6f commit eae26b6

File tree

181 files changed

+1779
-1781
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+1779
-1781
lines changed

clang/test/CodeGen/PowerPC/builtins-ppc-p10vector.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,11 +1551,11 @@ vector float test_vec_vec_splati_f(void) {
15511551

15521552
vector double test_vec_vec_splatid(void) {
15531553
// CHECK-BE: [[T1:%.+]] = fpext float %{{.+}} to double
1554-
// CHECK-BE-NEXT: [[T2:%.+]] = insertelement <2 x double> poison, double [[T1:%.+]], i32 0
1554+
// CHECK-BE-NEXT: [[T2:%.+]] = insertelement <2 x double> poison, double [[T1:%.+]], i64 0
15551555
// CHECK-BE-NEXT: [[T3:%.+]] = shufflevector <2 x double> [[T2:%.+]], <2 x double> poison, <2 x i32> zeroinitialize
15561556
// CHECK-BE-NEXT: ret <2 x double> [[T3:%.+]]
15571557
// CHECK-LE: [[T1:%.+]] = fpext float %{{.+}} to double
1558-
// CHECK-LE-NEXT: [[T2:%.+]] = insertelement <2 x double> poison, double [[T1:%.+]], i32 0
1558+
// CHECK-LE-NEXT: [[T2:%.+]] = insertelement <2 x double> poison, double [[T1:%.+]], i64 0
15591559
// CHECK-LE-NEXT: [[T3:%.+]] = shufflevector <2 x double> [[T2:%.+]], <2 x double> poison, <2 x i32> zeroinitialize
15601560
// CHECK-LE-NEXT: ret <2 x double> [[T3:%.+]]
15611561
return vec_splatid(1.0);

clang/test/CodeGen/SystemZ/zvector.c

Lines changed: 32 additions & 32 deletions
Large diffs are not rendered by default.

clang/test/CodeGen/aarch64-sve-vector-arith-ops.c

Lines changed: 52 additions & 52 deletions
Large diffs are not rendered by default.

clang/test/CodeGen/aarch64-sve-vector-bitwise-ops.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ svuint64_t xor_u64(svuint64_t a, svuint64_t b) {
260260

261261
// CHECK-LABEL: @neg_bool(
262262
// CHECK-NEXT: entry:
263-
// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 16 x i1> [[A:%.*]], shufflevector (<vscale x 16 x i1> insertelement (<vscale x 16 x i1> poison, i1 true, i32 0), <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer)
263+
// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 16 x i1> [[A:%.*]], shufflevector (<vscale x 16 x i1> insertelement (<vscale x 16 x i1> poison, i1 true, i64 0), <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer)
264264
// CHECK-NEXT: ret <vscale x 16 x i1> [[NEG]]
265265
//
266266
svbool_t neg_bool(svbool_t a) {
@@ -269,7 +269,7 @@ svbool_t neg_bool(svbool_t a) {
269269

270270
// CHECK-LABEL: @neg_i8(
271271
// CHECK-NEXT: entry:
272-
// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 16 x i8> [[A:%.*]], shufflevector (<vscale x 16 x i8> insertelement (<vscale x 16 x i8> poison, i8 -1, i32 0), <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer)
272+
// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 16 x i8> [[A:%.*]], shufflevector (<vscale x 16 x i8> insertelement (<vscale x 16 x i8> poison, i8 -1, i64 0), <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer)
273273
// CHECK-NEXT: ret <vscale x 16 x i8> [[NEG]]
274274
//
275275
svint8_t neg_i8(svint8_t a) {
@@ -278,7 +278,7 @@ svint8_t neg_i8(svint8_t a) {
278278

279279
// CHECK-LABEL: @neg_i16(
280280
// CHECK-NEXT: entry:
281-
// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 8 x i16> [[A:%.*]], shufflevector (<vscale x 8 x i16> insertelement (<vscale x 8 x i16> poison, i16 -1, i32 0), <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer)
281+
// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 8 x i16> [[A:%.*]], shufflevector (<vscale x 8 x i16> insertelement (<vscale x 8 x i16> poison, i16 -1, i64 0), <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer)
282282
// CHECK-NEXT: ret <vscale x 8 x i16> [[NEG]]
283283
//
284284
svint16_t neg_i16(svint16_t a) {
@@ -287,7 +287,7 @@ svint16_t neg_i16(svint16_t a) {
287287

288288
// CHECK-LABEL: @neg_i32(
289289
// CHECK-NEXT: entry:
290-
// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 4 x i32> [[A:%.*]], shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> poison, i32 -1, i32 0), <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer)
290+
// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 4 x i32> [[A:%.*]], shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> poison, i32 -1, i64 0), <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer)
291291
// CHECK-NEXT: ret <vscale x 4 x i32> [[NEG]]
292292
//
293293
svint32_t neg_i32(svint32_t a) {
@@ -296,7 +296,7 @@ svint32_t neg_i32(svint32_t a) {
296296

297297
// CHECK-LABEL: @neg_i64(
298298
// CHECK-NEXT: entry:
299-
// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 2 x i64> [[A:%.*]], shufflevector (<vscale x 2 x i64> insertelement (<vscale x 2 x i64> poison, i64 -1, i32 0), <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer)
299+
// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 2 x i64> [[A:%.*]], shufflevector (<vscale x 2 x i64> insertelement (<vscale x 2 x i64> poison, i64 -1, i64 0), <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer)
300300
// CHECK-NEXT: ret <vscale x 2 x i64> [[NEG]]
301301
//
302302
svint64_t neg_i64(svint64_t a) {
@@ -305,7 +305,7 @@ svint64_t neg_i64(svint64_t a) {
305305

306306
// CHECK-LABEL: @neg_u8(
307307
// CHECK-NEXT: entry:
308-
// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 16 x i8> [[A:%.*]], shufflevector (<vscale x 16 x i8> insertelement (<vscale x 16 x i8> poison, i8 -1, i32 0), <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer)
308+
// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 16 x i8> [[A:%.*]], shufflevector (<vscale x 16 x i8> insertelement (<vscale x 16 x i8> poison, i8 -1, i64 0), <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer)
309309
// CHECK-NEXT: ret <vscale x 16 x i8> [[NEG]]
310310
//
311311
svuint8_t neg_u8(svuint8_t a) {
@@ -314,7 +314,7 @@ svuint8_t neg_u8(svuint8_t a) {
314314

315315
// CHECK-LABEL: @neg_u16(
316316
// CHECK-NEXT: entry:
317-
// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 8 x i16> [[A:%.*]], shufflevector (<vscale x 8 x i16> insertelement (<vscale x 8 x i16> poison, i16 -1, i32 0), <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer)
317+
// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 8 x i16> [[A:%.*]], shufflevector (<vscale x 8 x i16> insertelement (<vscale x 8 x i16> poison, i16 -1, i64 0), <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer)
318318
// CHECK-NEXT: ret <vscale x 8 x i16> [[NEG]]
319319
//
320320
svuint16_t neg_u16(svuint16_t a) {
@@ -323,7 +323,7 @@ svuint16_t neg_u16(svuint16_t a) {
323323

324324
// CHECK-LABEL: @neg_u32(
325325
// CHECK-NEXT: entry:
326-
// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 4 x i32> [[A:%.*]], shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> poison, i32 -1, i32 0), <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer)
326+
// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 4 x i32> [[A:%.*]], shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> poison, i32 -1, i64 0), <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer)
327327
// CHECK-NEXT: ret <vscale x 4 x i32> [[NEG]]
328328
//
329329
svuint32_t neg_u32(svuint32_t a) {
@@ -332,7 +332,7 @@ svuint32_t neg_u32(svuint32_t a) {
332332

333333
// CHECK-LABEL: @neg_u64(
334334
// CHECK-NEXT: entry:
335-
// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 2 x i64> [[A:%.*]], shufflevector (<vscale x 2 x i64> insertelement (<vscale x 2 x i64> poison, i64 -1, i32 0), <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer)
335+
// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 2 x i64> [[A:%.*]], shufflevector (<vscale x 2 x i64> insertelement (<vscale x 2 x i64> poison, i64 -1, i64 0), <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer)
336336
// CHECK-NEXT: ret <vscale x 2 x i64> [[NEG]]
337337
//
338338
svuint64_t neg_u64(svuint64_t a) {

0 commit comments

Comments
 (0)