Skip to content

Commit 6a72003

Browse files
author
git apple-llvm automerger
committed
Merge commit '7d3f069b4fca' from apple/main into swift/next
2 parents bc545af + 7d3f069 commit 6a72003

File tree

3 files changed

+27
-23
lines changed

3 files changed

+27
-23
lines changed

llvm/test/Transforms/InstCombine/X86/x86-sse4a.ll

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
define <2 x i64> @test_extrq_call(<2 x i64> %x, <16 x i8> %y) {
99
; CHECK-LABEL: @test_extrq_call(
10-
; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64> [[X:%.*]], <16 x i8> [[Y:%.*]]) #1
10+
; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64> [[X:%.*]], <16 x i8> [[Y:%.*]]) [[ATTR1:#.*]]
1111
; CHECK-NEXT: ret <2 x i64> [[TMP1]]
1212
;
1313
%1 = tail call <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64> %x, <16 x i8> %y) nounwind
@@ -150,7 +150,7 @@ define <2 x i64> @test_extrqi_call_constexpr() {
150150

151151
define <2 x i64> @test_insertq_call(<2 x i64> %x, <2 x i64> %y) {
152152
; CHECK-LABEL: @test_insertq_call(
153-
; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.insertq(<2 x i64> [[X:%.*]], <2 x i64> [[Y:%.*]]) #1
153+
; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.insertq(<2 x i64> [[X:%.*]], <2 x i64> [[Y:%.*]]) [[ATTR1]]
154154
; CHECK-NEXT: ret <2 x i64> [[TMP1]]
155155
;
156156
%1 = tail call <2 x i64> @llvm.x86.sse4a.insertq(<2 x i64> %x, <2 x i64> %y) nounwind
@@ -291,7 +291,7 @@ define <2 x i64> @testUndefinedInsertq_3(<2 x i64> %v, <2 x i64> %i) {
291291

292292
define <2 x i64> @test_extrq_arg0(<2 x i64> %x, <16 x i8> %y) {
293293
; CHECK-LABEL: @test_extrq_arg0(
294-
; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64> [[X:%.*]], <16 x i8> [[Y:%.*]]) #1
294+
; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64> [[X:%.*]], <16 x i8> [[Y:%.*]]) [[ATTR1]]
295295
; CHECK-NEXT: ret <2 x i64> [[TMP1]]
296296
;
297297
%1 = shufflevector <2 x i64> %x, <2 x i64> undef, <2 x i32> <i32 0, i32 0>
@@ -301,7 +301,7 @@ define <2 x i64> @test_extrq_arg0(<2 x i64> %x, <16 x i8> %y) {
301301

302302
define <2 x i64> @test_extrq_arg1(<2 x i64> %x, <16 x i8> %y) {
303303
; CHECK-LABEL: @test_extrq_arg1(
304-
; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64> [[X:%.*]], <16 x i8> [[Y:%.*]]) #1
304+
; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64> [[X:%.*]], <16 x i8> [[Y:%.*]]) [[ATTR1]]
305305
; CHECK-NEXT: ret <2 x i64> [[TMP1]]
306306
;
307307
%1 = shufflevector <16 x i8> %y, <16 x i8> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
@@ -311,7 +311,7 @@ define <2 x i64> @test_extrq_arg1(<2 x i64> %x, <16 x i8> %y) {
311311

312312
define <2 x i64> @test_extrq_args01(<2 x i64> %x, <16 x i8> %y) {
313313
; CHECK-LABEL: @test_extrq_args01(
314-
; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64> [[X:%.*]], <16 x i8> [[Y:%.*]]) #1
314+
; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64> [[X:%.*]], <16 x i8> [[Y:%.*]]) [[ATTR1]]
315315
; CHECK-NEXT: ret <2 x i64> [[TMP1]]
316316
;
317317
%1 = shufflevector <2 x i64> %x, <2 x i64> undef, <2 x i32> <i32 0, i32 0>
@@ -350,7 +350,7 @@ define <2 x i64> @test_extrqi_ret(<2 x i64> %x) {
350350

351351
define <2 x i64> @test_insertq_arg0(<2 x i64> %x, <2 x i64> %y) {
352352
; CHECK-LABEL: @test_insertq_arg0(
353-
; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.insertq(<2 x i64> [[X:%.*]], <2 x i64> [[Y:%.*]]) #1
353+
; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.insertq(<2 x i64> [[X:%.*]], <2 x i64> [[Y:%.*]]) [[ATTR1]]
354354
; CHECK-NEXT: ret <2 x i64> [[TMP1]]
355355
;
356356
%1 = shufflevector <2 x i64> %x, <2 x i64> undef, <2 x i32> <i32 0, i32 0>
@@ -369,7 +369,7 @@ define <2 x i64> @test_insertq_ret(<2 x i64> %x, <2 x i64> %y) {
369369

370370
define <2 x i64> @test_insertqi_arg0(<2 x i64> %x, <2 x i64> %y) {
371371
; CHECK-LABEL: @test_insertqi_arg0(
372-
; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> [[X:%.*]], <2 x i64> [[Y:%.*]], i8 3, i8 2) #1
372+
; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> [[X:%.*]], <2 x i64> [[Y:%.*]], i8 3, i8 2) [[ATTR1]]
373373
; CHECK-NEXT: ret <2 x i64> [[TMP1]]
374374
;
375375
%1 = shufflevector <2 x i64> %x, <2 x i64> undef, <2 x i32> <i32 0, i32 0>
@@ -379,7 +379,7 @@ define <2 x i64> @test_insertqi_arg0(<2 x i64> %x, <2 x i64> %y) {
379379

380380
define <2 x i64> @test_insertqi_arg1(<2 x i64> %x, <2 x i64> %y) {
381381
; CHECK-LABEL: @test_insertqi_arg1(
382-
; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> [[X:%.*]], <2 x i64> [[Y:%.*]], i8 3, i8 2) #1
382+
; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> [[X:%.*]], <2 x i64> [[Y:%.*]], i8 3, i8 2) [[ATTR1]]
383383
; CHECK-NEXT: ret <2 x i64> [[TMP1]]
384384
;
385385
%1 = shufflevector <2 x i64> %y, <2 x i64> undef, <2 x i32> <i32 0, i32 0>
@@ -389,7 +389,7 @@ define <2 x i64> @test_insertqi_arg1(<2 x i64> %x, <2 x i64> %y) {
389389

390390
define <2 x i64> @test_insertqi_args01(<2 x i64> %x, <2 x i64> %y) {
391391
; CHECK-LABEL: @test_insertqi_args01(
392-
; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> [[X:%.*]], <2 x i64> [[Y:%.*]], i8 3, i8 2) #1
392+
; CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> [[X:%.*]], <2 x i64> [[Y:%.*]], i8 3, i8 2) [[ATTR1]]
393393
; CHECK-NEXT: ret <2 x i64> [[TMP1]]
394394
;
395395
%1 = shufflevector <2 x i64> %x, <2 x i64> undef, <2 x i32> <i32 0, i32 0>

llvm/test/Transforms/InstCombine/bitcast.ll

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ define <2 x i32> @or_bitcast_int_to_vec(i64 %a) {
7575

7676
define <2 x i64> @is_negative(<4 x i32> %x) {
7777
; CHECK-LABEL: @is_negative(
78-
; CHECK-NEXT: [[LOBIT:%.*]] = ashr <4 x i32> %x, <i32 31, i32 31, i32 31, i32 31>
79-
; CHECK-NEXT: [[NOTNOT:%.*]] = bitcast <4 x i32> [[LOBIT]] to <2 x i64>
80-
; CHECK-NEXT: ret <2 x i64> [[NOTNOT]]
78+
; CHECK-NEXT: [[LOBIT:%.*]] = ashr <4 x i32> [[X:%.*]], <i32 31, i32 31, i32 31, i32 31>
79+
; CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[LOBIT]] to <2 x i64>
80+
; CHECK-NEXT: ret <2 x i64> [[TMP1]]
8181
;
8282
%lobit = ashr <4 x i32> %x, <i32 31, i32 31, i32 31, i32 31>
8383
%not = xor <4 x i32> %lobit, <i32 -1, i32 -1, i32 -1, i32 -1>
@@ -91,7 +91,7 @@ define <2 x i64> @is_negative(<4 x i32> %x) {
9191

9292
define <4 x i32> @is_negative_bonus_bitcast(<4 x i32> %x) {
9393
; CHECK-LABEL: @is_negative_bonus_bitcast(
94-
; CHECK-NEXT: [[LOBIT:%.*]] = ashr <4 x i32> %x, <i32 31, i32 31, i32 31, i32 31>
94+
; CHECK-NEXT: [[LOBIT:%.*]] = ashr <4 x i32> [[X:%.*]], <i32 31, i32 31, i32 31, i32 31>
9595
; CHECK-NEXT: ret <4 x i32> [[LOBIT]]
9696
;
9797
%lobit = ashr <4 x i32> %x, <i32 31, i32 31, i32 31, i32 31>
@@ -564,6 +564,10 @@ define void @constant_fold_vector_to_half() {
564564

565565
; Ensure that we do not crash when looking at such a weird bitcast.
566566
define i8* @bitcast_from_single_element_pointer_vector_to_pointer(<1 x i8*> %ptrvec) {
567+
; CHECK-LABEL: @bitcast_from_single_element_pointer_vector_to_pointer(
568+
; CHECK-NEXT: [[TMP1:%.*]] = extractelement <1 x i8*> [[PTRVEC:%.*]], i32 0
569+
; CHECK-NEXT: ret i8* [[TMP1]]
570+
;
567571
%ptr = bitcast <1 x i8*> %ptrvec to i8*
568572
ret i8* %ptr
569573
}

llvm/test/Transforms/InstCombine/insert-const-shuf.ll

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
define <4 x float> @PR29126(<4 x float> %x) {
77
; CHECK-LABEL: @PR29126(
8-
; CHECK-NEXT: [[INS:%.*]] = shufflevector <4 x float> %x, <4 x float> <float undef, float 1.000000e+00, float 2.000000e+00, float 4.200000e+01>, <4 x i32> <i32 0, i32 5, i32 6, i32 7>
8+
; CHECK-NEXT: [[INS:%.*]] = shufflevector <4 x float> [[X:%.*]], <4 x float> <float undef, float 1.000000e+00, float 2.000000e+00, float 4.200000e+01>, <4 x i32> <i32 0, i32 5, i32 6, i32 7>
99
; CHECK-NEXT: ret <4 x float> [[INS]]
1010
;
1111
%shuf = shufflevector <4 x float> %x, <4 x float> <float undef, float 1.0, float 2.0, float undef>, <4 x i32> <i32 0, i32 5, i32 6, i32 3>
@@ -17,7 +17,7 @@ define <4 x float> @PR29126(<4 x float> %x) {
1717

1818
define <4 x float> @twoInserts(<4 x float> %x) {
1919
; CHECK-LABEL: @twoInserts(
20-
; CHECK-NEXT: [[INS2:%.*]] = shufflevector <4 x float> %x, <4 x float> <float undef, float 0.000000e+00, float 4.200000e+01, float 1.100000e+01>, <4 x i32> <i32 0, i32 5, i32 6, i32 7>
20+
; CHECK-NEXT: [[INS2:%.*]] = shufflevector <4 x float> [[X:%.*]], <4 x float> <float undef, float 0.000000e+00, float 4.200000e+01, float 1.100000e+01>, <4 x i32> <i32 0, i32 5, i32 6, i32 7>
2121
; CHECK-NEXT: ret <4 x float> [[INS2]]
2222
;
2323
%shuf = shufflevector <4 x float> %x, <4 x float> zeroinitializer, <4 x i32> <i32 0, i32 5, i32 6, i32 3>
@@ -28,8 +28,8 @@ define <4 x float> @twoInserts(<4 x float> %x) {
2828

2929
define <4 x i32> @shuffleRetain(<4 x i32> %base) {
3030
; CHECK-LABEL: @shuffleRetain(
31-
; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <4 x i32> %base, <4 x i32> <i32 undef, i32 undef, i32 undef, i32 1>, <4 x i32> <i32 1, i32 2, i32 undef, i32 7>
32-
; CHECK-NEXT: ret <4 x i32> [[SHUF]]
31+
; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <4 x i32> [[BASE:%.*]], <4 x i32> <i32 undef, i32 undef, i32 undef, i32 1>, <4 x i32> <i32 1, i32 2, i32 undef, i32 7>
32+
; CHECK-NEXT: ret <4 x i32> [[SHUF]]
3333
;
3434
%shuf = shufflevector <4 x i32> %base, <4 x i32> <i32 4, i32 3, i32 2, i32 1>, <4 x i32> <i32 1, i32 2, i32 undef, i32 7>
3535
ret <4 x i32> %shuf
@@ -39,7 +39,7 @@ define <4 x i32> @shuffleRetain(<4 x i32> %base) {
3939

4040
define <4 x float> @disguisedSelect(<4 x float> %x) {
4141
; CHECK-LABEL: @disguisedSelect(
42-
; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <4 x float> %x, <4 x float> <float undef, float 1.000000e+00, float 2.000000e+00, float undef>, <4 x i32> <i32 undef, i32 6, i32 5, i32 3>
42+
; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <4 x float> [[X:%.*]], <4 x float> <float undef, float 1.000000e+00, float 2.000000e+00, float undef>, <4 x i32> <i32 undef, i32 6, i32 5, i32 3>
4343
; CHECK-NEXT: [[INS:%.*]] = insertelement <4 x float> [[SHUF]], float 4.000000e+00, i32 0
4444
; CHECK-NEXT: ret <4 x float> [[INS]]
4545
;
@@ -52,7 +52,7 @@ define <4 x float> @disguisedSelect(<4 x float> %x) {
5252

5353
define <4 x float> @notSelectButNoMaskDifference(<4 x float> %x) {
5454
; CHECK-LABEL: @notSelectButNoMaskDifference(
55-
; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <4 x float> %x, <4 x float> <float undef, float 1.000000e+00, float 2.000000e+00, float undef>, <4 x i32> <i32 1, i32 5, i32 6, i32 undef>
55+
; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <4 x float> [[X:%.*]], <4 x float> <float undef, float 1.000000e+00, float 2.000000e+00, float undef>, <4 x i32> <i32 1, i32 5, i32 6, i32 undef>
5656
; CHECK-NEXT: [[INS:%.*]] = insertelement <4 x float> [[SHUF]], float 4.000000e+00, i32 3
5757
; CHECK-NEXT: ret <4 x float> [[INS]]
5858
;
@@ -65,7 +65,7 @@ define <4 x float> @notSelectButNoMaskDifference(<4 x float> %x) {
6565

6666
define <4 x float> @tooRisky(<4 x float> %x) {
6767
; CHECK-LABEL: @tooRisky(
68-
; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <4 x float> %x, <4 x float> <float 1.000000e+00, float undef, float undef, float undef>, <4 x i32> <i32 1, i32 4, i32 4, i32 undef>
68+
; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <4 x float> [[X:%.*]], <4 x float> <float 1.000000e+00, float undef, float undef, float undef>, <4 x i32> <i32 1, i32 4, i32 4, i32 undef>
6969
; CHECK-NEXT: [[INS:%.*]] = insertelement <4 x float> [[SHUF]], float 4.000000e+00, i32 3
7070
; CHECK-NEXT: ret <4 x float> [[INS]]
7171
;
@@ -79,7 +79,7 @@ define <4 x float> @tooRisky(<4 x float> %x) {
7979

8080
define <3 x float> @twoShufUses(<3 x float> %x) {
8181
; CHECK-LABEL: @twoShufUses(
82-
; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <3 x float> %x, <3 x float> <float undef, float 1.000000e+00, float 2.000000e+00>, <3 x i32> <i32 0, i32 4, i32 5>
82+
; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <3 x float> [[X:%.*]], <3 x float> <float undef, float 1.000000e+00, float 2.000000e+00>, <3 x i32> <i32 0, i32 4, i32 5>
8383
; CHECK-NEXT: [[INS:%.*]] = insertelement <3 x float> [[SHUF]], float 4.200000e+01, i2 1
8484
; CHECK-NEXT: [[ADD:%.*]] = fadd <3 x float> [[SHUF]], [[INS]]
8585
; CHECK-NEXT: ret <3 x float> [[ADD]]
@@ -94,7 +94,7 @@ define <3 x float> @twoShufUses(<3 x float> %x) {
9494

9595
define <5 x i8> @longerMask(<3 x i8> %x) {
9696
; CHECK-LABEL: @longerMask(
97-
; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <3 x i8> %x, <3 x i8> <i8 undef, i8 1, i8 undef>, <5 x i32> <i32 2, i32 1, i32 4, i32 undef, i32 undef>
97+
; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <3 x i8> [[X:%.*]], <3 x i8> <i8 undef, i8 1, i8 undef>, <5 x i32> <i32 2, i32 1, i32 4, i32 undef, i32 undef>
9898
; CHECK-NEXT: [[INS:%.*]] = insertelement <5 x i8> [[SHUF]], i8 42, i17 4
9999
; CHECK-NEXT: ret <5 x i8> [[INS]]
100100
;
@@ -107,7 +107,7 @@ define <5 x i8> @longerMask(<3 x i8> %x) {
107107

108108
define <3 x i8> @shorterMask(<5 x i8> %x) {
109109
; CHECK-LABEL: @shorterMask(
110-
; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <5 x i8> %x, <5 x i8> undef, <3 x i32> <i32 undef, i32 1, i32 4>
110+
; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <5 x i8> [[X:%.*]], <5 x i8> undef, <3 x i32> <i32 undef, i32 1, i32 4>
111111
; CHECK-NEXT: [[INS:%.*]] = insertelement <3 x i8> [[SHUF]], i8 42, i21 0
112112
; CHECK-NEXT: ret <3 x i8> [[INS]]
113113
;

0 commit comments

Comments
 (0)