Skip to content

Commit 78bf832

Browse files
committed
update testcases
1 parent 82ff301 commit 78bf832

File tree

4 files changed

+70
-102
lines changed

4 files changed

+70
-102
lines changed

llvm/test/Transforms/VectorCombine/X86/extract-binop-inseltpoison.ll

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -417,18 +417,11 @@ define float @ext14_ext15_fmul_v16f32(<16 x float> %x) {
417417
}
418418

419419
define <4 x float> @ins_bo_ext_ext(<4 x float> %a, <4 x float> %b) {
420-
; SSE-LABEL: @ins_bo_ext_ext(
421-
; SSE-NEXT: [[SHIFT:%.*]] = shufflevector <4 x float> [[A:%.*]], <4 x float> poison, <4 x i32> <i32 poison, i32 poison, i32 poison, i32 2>
422-
; SSE-NEXT: [[TMP1:%.*]] = fadd <4 x float> [[SHIFT]], [[A]]
423-
; SSE-NEXT: [[A23:%.*]] = extractelement <4 x float> [[TMP1]], i64 3
424-
; SSE-NEXT: [[V3:%.*]] = insertelement <4 x float> [[B:%.*]], float [[A23]], i32 3
425-
; SSE-NEXT: ret <4 x float> [[V3]]
426-
;
427-
; AVX-LABEL: @ins_bo_ext_ext(
428-
; AVX-NEXT: [[SHIFT:%.*]] = shufflevector <4 x float> [[A:%.*]], <4 x float> poison, <4 x i32> <i32 poison, i32 poison, i32 poison, i32 2>
429-
; AVX-NEXT: [[TMP1:%.*]] = fadd <4 x float> [[SHIFT]], [[A]]
430-
; AVX-NEXT: [[V3:%.*]] = shufflevector <4 x float> [[B:%.*]], <4 x float> [[TMP1]], <4 x i32> <i32 0, i32 1, i32 2, i32 7>
431-
; AVX-NEXT: ret <4 x float> [[V3]]
420+
; CHECK-LABEL: @ins_bo_ext_ext(
421+
; CHECK-NEXT: [[SHIFT:%.*]] = shufflevector <4 x float> [[A:%.*]], <4 x float> poison, <4 x i32> <i32 poison, i32 poison, i32 poison, i32 2>
422+
; CHECK-NEXT: [[TMP1:%.*]] = fadd <4 x float> [[SHIFT]], [[A]]
423+
; CHECK-NEXT: [[V3:%.*]] = shufflevector <4 x float> [[B:%.*]], <4 x float> [[TMP1]], <4 x i32> <i32 0, i32 1, i32 2, i32 7>
424+
; CHECK-NEXT: ret <4 x float> [[V3]]
432425
;
433426
%a2 = extractelement <4 x float> %a, i32 2
434427
%a3 = extractelement <4 x float> %a, i32 3
@@ -441,13 +434,21 @@ define <4 x float> @ins_bo_ext_ext(<4 x float> %a, <4 x float> %b) {
441434
; but it is likely that extracting from index 3 is the better option.
442435

443436
define <4 x float> @ins_bo_ext_ext_uses(<4 x float> %a, <4 x float> %b) {
444-
; CHECK-LABEL: @ins_bo_ext_ext_uses(
445-
; CHECK-NEXT: [[SHIFT:%.*]] = shufflevector <4 x float> [[A:%.*]], <4 x float> poison, <4 x i32> <i32 poison, i32 poison, i32 3, i32 poison>
446-
; CHECK-NEXT: [[TMP1:%.*]] = fadd <4 x float> [[A]], [[SHIFT]]
447-
; CHECK-NEXT: [[A23:%.*]] = extractelement <4 x float> [[TMP1]], i32 2
448-
; CHECK-NEXT: call void @use_f32(float [[A23]])
449-
; CHECK-NEXT: [[V3:%.*]] = insertelement <4 x float> [[B:%.*]], float [[A23]], i32 3
450-
; CHECK-NEXT: ret <4 x float> [[V3]]
437+
; SSE-LABEL: @ins_bo_ext_ext_uses(
438+
; SSE-NEXT: [[SHIFT:%.*]] = shufflevector <4 x float> [[A:%.*]], <4 x float> poison, <4 x i32> <i32 poison, i32 poison, i32 3, i32 poison>
439+
; SSE-NEXT: [[TMP1:%.*]] = fadd <4 x float> [[A]], [[SHIFT]]
440+
; SSE-NEXT: [[A23:%.*]] = extractelement <4 x float> [[TMP1]], i32 2
441+
; SSE-NEXT: call void @use_f32(float [[A23]])
442+
; SSE-NEXT: [[V3:%.*]] = shufflevector <4 x float> [[B:%.*]], <4 x float> [[TMP1]], <4 x i32> <i32 0, i32 1, i32 2, i32 6>
443+
; SSE-NEXT: ret <4 x float> [[V3]]
444+
;
445+
; AVX-LABEL: @ins_bo_ext_ext_uses(
446+
; AVX-NEXT: [[SHIFT:%.*]] = shufflevector <4 x float> [[A:%.*]], <4 x float> poison, <4 x i32> <i32 poison, i32 poison, i32 3, i32 poison>
447+
; AVX-NEXT: [[TMP1:%.*]] = fadd <4 x float> [[A]], [[SHIFT]]
448+
; AVX-NEXT: [[A23:%.*]] = extractelement <4 x float> [[TMP1]], i32 2
449+
; AVX-NEXT: call void @use_f32(float [[A23]])
450+
; AVX-NEXT: [[V3:%.*]] = insertelement <4 x float> [[B:%.*]], float [[A23]], i32 3
451+
; AVX-NEXT: ret <4 x float> [[V3]]
451452
;
452453
%a2 = extractelement <4 x float> %a, i32 2
453454
%a3 = extractelement <4 x float> %a, i32 3
@@ -463,16 +464,13 @@ define <4 x float> @PR34724(<4 x float> %a, <4 x float> %b) {
463464
; SSE-NEXT: [[A1:%.*]] = extractelement <4 x float> [[A]], i32 1
464465
; SSE-NEXT: [[SHIFT:%.*]] = shufflevector <4 x float> [[A]], <4 x float> poison, <4 x i32> <i32 poison, i32 poison, i32 3, i32 poison>
465466
; SSE-NEXT: [[TMP1:%.*]] = fadd <4 x float> [[A]], [[SHIFT]]
466-
; SSE-NEXT: [[A23:%.*]] = extractelement <4 x float> [[TMP1]], i32 2
467467
; SSE-NEXT: [[SHIFT1:%.*]] = shufflevector <4 x float> [[B:%.*]], <4 x float> poison, <4 x i32> <i32 1, i32 poison, i32 poison, i32 poison>
468468
; SSE-NEXT: [[TMP2:%.*]] = fadd <4 x float> [[B]], [[SHIFT1]]
469-
; SSE-NEXT: [[B01:%.*]] = extractelement <4 x float> [[TMP2]], i32 0
470469
; SSE-NEXT: [[SHIFT2:%.*]] = shufflevector <4 x float> [[B]], <4 x float> poison, <4 x i32> <i32 poison, i32 poison, i32 poison, i32 2>
471470
; SSE-NEXT: [[TMP3:%.*]] = fadd <4 x float> [[SHIFT2]], [[B]]
472-
; SSE-NEXT: [[B23:%.*]] = extractelement <4 x float> [[TMP3]], i64 3
473-
; SSE-NEXT: [[V1:%.*]] = insertelement <4 x float> poison, float [[A23]], i32 1
474-
; SSE-NEXT: [[V2:%.*]] = insertelement <4 x float> [[V1]], float [[B01]], i32 2
475-
; SSE-NEXT: [[V3:%.*]] = insertelement <4 x float> [[V2]], float [[B23]], i32 3
471+
; SSE-NEXT: [[V1:%.*]] = shufflevector <4 x float> poison, <4 x float> [[TMP1]], <4 x i32> <i32 0, i32 6, i32 2, i32 3>
472+
; SSE-NEXT: [[V2:%.*]] = shufflevector <4 x float> [[V1]], <4 x float> [[TMP2]], <4 x i32> <i32 0, i32 1, i32 4, i32 3>
473+
; SSE-NEXT: [[V3:%.*]] = shufflevector <4 x float> [[V2]], <4 x float> [[TMP3]], <4 x i32> <i32 0, i32 1, i32 2, i32 7>
476474
; SSE-NEXT: ret <4 x float> [[V3]]
477475
;
478476
; AVX-LABEL: @PR34724(

llvm/test/Transforms/VectorCombine/X86/extract-binop.ll

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -417,18 +417,11 @@ define float @ext14_ext15_fmul_v16f32(<16 x float> %x) {
417417
}
418418

419419
define <4 x float> @ins_bo_ext_ext(<4 x float> %a, <4 x float> %b) {
420-
; SSE-LABEL: @ins_bo_ext_ext(
421-
; SSE-NEXT: [[SHIFT:%.*]] = shufflevector <4 x float> [[A:%.*]], <4 x float> poison, <4 x i32> <i32 poison, i32 poison, i32 poison, i32 2>
422-
; SSE-NEXT: [[TMP1:%.*]] = fadd <4 x float> [[SHIFT]], [[A]]
423-
; SSE-NEXT: [[A23:%.*]] = extractelement <4 x float> [[TMP1]], i64 3
424-
; SSE-NEXT: [[V3:%.*]] = insertelement <4 x float> [[B:%.*]], float [[A23]], i32 3
425-
; SSE-NEXT: ret <4 x float> [[V3]]
426-
;
427-
; AVX-LABEL: @ins_bo_ext_ext(
428-
; AVX-NEXT: [[SHIFT:%.*]] = shufflevector <4 x float> [[A:%.*]], <4 x float> poison, <4 x i32> <i32 poison, i32 poison, i32 poison, i32 2>
429-
; AVX-NEXT: [[TMP1:%.*]] = fadd <4 x float> [[SHIFT]], [[A]]
430-
; AVX-NEXT: [[V3:%.*]] = shufflevector <4 x float> [[B:%.*]], <4 x float> [[TMP1]], <4 x i32> <i32 0, i32 1, i32 2, i32 7>
431-
; AVX-NEXT: ret <4 x float> [[V3]]
420+
; CHECK-LABEL: @ins_bo_ext_ext(
421+
; CHECK-NEXT: [[SHIFT:%.*]] = shufflevector <4 x float> [[A:%.*]], <4 x float> poison, <4 x i32> <i32 poison, i32 poison, i32 poison, i32 2>
422+
; CHECK-NEXT: [[TMP1:%.*]] = fadd <4 x float> [[SHIFT]], [[A]]
423+
; CHECK-NEXT: [[V3:%.*]] = shufflevector <4 x float> [[B:%.*]], <4 x float> [[TMP1]], <4 x i32> <i32 0, i32 1, i32 2, i32 7>
424+
; CHECK-NEXT: ret <4 x float> [[V3]]
432425
;
433426
%a2 = extractelement <4 x float> %a, i32 2
434427
%a3 = extractelement <4 x float> %a, i32 3
@@ -441,13 +434,21 @@ define <4 x float> @ins_bo_ext_ext(<4 x float> %a, <4 x float> %b) {
441434
; but it is likely that extracting from index 3 is the better option.
442435

443436
define <4 x float> @ins_bo_ext_ext_uses(<4 x float> %a, <4 x float> %b) {
444-
; CHECK-LABEL: @ins_bo_ext_ext_uses(
445-
; CHECK-NEXT: [[SHIFT:%.*]] = shufflevector <4 x float> [[A:%.*]], <4 x float> poison, <4 x i32> <i32 poison, i32 poison, i32 3, i32 poison>
446-
; CHECK-NEXT: [[TMP1:%.*]] = fadd <4 x float> [[A]], [[SHIFT]]
447-
; CHECK-NEXT: [[A23:%.*]] = extractelement <4 x float> [[TMP1]], i32 2
448-
; CHECK-NEXT: call void @use_f32(float [[A23]])
449-
; CHECK-NEXT: [[V3:%.*]] = insertelement <4 x float> [[B:%.*]], float [[A23]], i32 3
450-
; CHECK-NEXT: ret <4 x float> [[V3]]
437+
; SSE-LABEL: @ins_bo_ext_ext_uses(
438+
; SSE-NEXT: [[SHIFT:%.*]] = shufflevector <4 x float> [[A:%.*]], <4 x float> poison, <4 x i32> <i32 poison, i32 poison, i32 3, i32 poison>
439+
; SSE-NEXT: [[TMP1:%.*]] = fadd <4 x float> [[A]], [[SHIFT]]
440+
; SSE-NEXT: [[A23:%.*]] = extractelement <4 x float> [[TMP1]], i32 2
441+
; SSE-NEXT: call void @use_f32(float [[A23]])
442+
; SSE-NEXT: [[V3:%.*]] = shufflevector <4 x float> [[B:%.*]], <4 x float> [[TMP1]], <4 x i32> <i32 0, i32 1, i32 2, i32 6>
443+
; SSE-NEXT: ret <4 x float> [[V3]]
444+
;
445+
; AVX-LABEL: @ins_bo_ext_ext_uses(
446+
; AVX-NEXT: [[SHIFT:%.*]] = shufflevector <4 x float> [[A:%.*]], <4 x float> poison, <4 x i32> <i32 poison, i32 poison, i32 3, i32 poison>
447+
; AVX-NEXT: [[TMP1:%.*]] = fadd <4 x float> [[A]], [[SHIFT]]
448+
; AVX-NEXT: [[A23:%.*]] = extractelement <4 x float> [[TMP1]], i32 2
449+
; AVX-NEXT: call void @use_f32(float [[A23]])
450+
; AVX-NEXT: [[V3:%.*]] = insertelement <4 x float> [[B:%.*]], float [[A23]], i32 3
451+
; AVX-NEXT: ret <4 x float> [[V3]]
451452
;
452453
%a2 = extractelement <4 x float> %a, i32 2
453454
%a3 = extractelement <4 x float> %a, i32 3
@@ -463,16 +464,13 @@ define <4 x float> @PR34724(<4 x float> %a, <4 x float> %b) {
463464
; SSE-NEXT: [[A1:%.*]] = extractelement <4 x float> [[A]], i32 1
464465
; SSE-NEXT: [[SHIFT:%.*]] = shufflevector <4 x float> [[A]], <4 x float> poison, <4 x i32> <i32 poison, i32 poison, i32 3, i32 poison>
465466
; SSE-NEXT: [[TMP1:%.*]] = fadd <4 x float> [[A]], [[SHIFT]]
466-
; SSE-NEXT: [[A23:%.*]] = extractelement <4 x float> [[TMP1]], i32 2
467467
; SSE-NEXT: [[SHIFT1:%.*]] = shufflevector <4 x float> [[B:%.*]], <4 x float> poison, <4 x i32> <i32 1, i32 poison, i32 poison, i32 poison>
468468
; SSE-NEXT: [[TMP2:%.*]] = fadd <4 x float> [[B]], [[SHIFT1]]
469-
; SSE-NEXT: [[B01:%.*]] = extractelement <4 x float> [[TMP2]], i32 0
470469
; SSE-NEXT: [[SHIFT2:%.*]] = shufflevector <4 x float> [[B]], <4 x float> poison, <4 x i32> <i32 poison, i32 poison, i32 poison, i32 2>
471470
; SSE-NEXT: [[TMP3:%.*]] = fadd <4 x float> [[SHIFT2]], [[B]]
472-
; SSE-NEXT: [[B23:%.*]] = extractelement <4 x float> [[TMP3]], i64 3
473-
; SSE-NEXT: [[V1:%.*]] = insertelement <4 x float> undef, float [[A23]], i32 1
474-
; SSE-NEXT: [[V2:%.*]] = insertelement <4 x float> [[V1]], float [[B01]], i32 2
475-
; SSE-NEXT: [[V3:%.*]] = insertelement <4 x float> [[V2]], float [[B23]], i32 3
471+
; SSE-NEXT: [[V1:%.*]] = shufflevector <4 x float> undef, <4 x float> [[TMP1]], <4 x i32> <i32 0, i32 6, i32 2, i32 3>
472+
; SSE-NEXT: [[V2:%.*]] = shufflevector <4 x float> [[V1]], <4 x float> [[TMP2]], <4 x i32> <i32 0, i32 1, i32 4, i32 3>
473+
; SSE-NEXT: [[V3:%.*]] = shufflevector <4 x float> [[V2]], <4 x float> [[TMP3]], <4 x i32> <i32 0, i32 1, i32 2, i32 7>
476474
; SSE-NEXT: ret <4 x float> [[V3]]
477475
;
478476
; AVX-LABEL: @PR34724(

llvm/test/Transforms/VectorCombine/X86/load-inseltpoison.ll

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -537,32 +537,18 @@ define <2 x float> @load_f32_insert_v2f32_asan(ptr align 16 dereferenceable(16)
537537

538538
declare ptr @getscaleptr()
539539
define void @PR47558_multiple_use_load(ptr nocapture nonnull %resultptr, ptr nocapture nonnull readonly %opptr) nofree nosync {
540-
; SSE2-LABEL: @PR47558_multiple_use_load(
541-
; SSE2-NEXT: [[SCALEPTR:%.*]] = tail call nonnull align 16 dereferenceable(64) ptr @getscaleptr()
542-
; SSE2-NEXT: [[OP:%.*]] = load <2 x float>, ptr [[OPPTR:%.*]], align 4
543-
; SSE2-NEXT: [[SCALE:%.*]] = load float, ptr [[SCALEPTR]], align 16
544-
; SSE2-NEXT: [[T1:%.*]] = insertelement <2 x float> poison, float [[SCALE]], i32 0
545-
; SSE2-NEXT: [[T2:%.*]] = insertelement <2 x float> [[T1]], float [[SCALE]], i32 1
546-
; SSE2-NEXT: [[T3:%.*]] = fmul <2 x float> [[OP]], [[T2]]
547-
; SSE2-NEXT: [[T4:%.*]] = extractelement <2 x float> [[T3]], i32 0
548-
; SSE2-NEXT: [[RESULT0:%.*]] = insertelement <2 x float> poison, float [[T4]], i32 0
549-
; SSE2-NEXT: [[T5:%.*]] = extractelement <2 x float> [[T3]], i32 1
550-
; SSE2-NEXT: [[RESULT1:%.*]] = insertelement <2 x float> [[RESULT0]], float [[T5]], i32 1
551-
; SSE2-NEXT: store <2 x float> [[RESULT1]], ptr [[RESULTPTR:%.*]], align 8
552-
; SSE2-NEXT: ret void
553-
;
554-
; AVX2-LABEL: @PR47558_multiple_use_load(
555-
; AVX2-NEXT: [[SCALEPTR:%.*]] = tail call nonnull align 16 dereferenceable(64) ptr @getscaleptr()
556-
; AVX2-NEXT: [[OP:%.*]] = load <2 x float>, ptr [[OPPTR:%.*]], align 4
557-
; AVX2-NEXT: [[SCALE:%.*]] = load float, ptr [[SCALEPTR]], align 16
558-
; AVX2-NEXT: [[T1:%.*]] = insertelement <2 x float> poison, float [[SCALE]], i32 0
559-
; AVX2-NEXT: [[T2:%.*]] = insertelement <2 x float> [[T1]], float [[SCALE]], i32 1
560-
; AVX2-NEXT: [[T3:%.*]] = fmul <2 x float> [[OP]], [[T2]]
561-
; AVX2-NEXT: [[T4:%.*]] = extractelement <2 x float> [[T3]], i32 0
562-
; AVX2-NEXT: [[RESULT0:%.*]] = insertelement <2 x float> poison, float [[T4]], i32 0
563-
; AVX2-NEXT: [[RESULT1:%.*]] = shufflevector <2 x float> [[RESULT0]], <2 x float> [[T3]], <2 x i32> <i32 0, i32 3>
564-
; AVX2-NEXT: store <2 x float> [[RESULT1]], ptr [[RESULTPTR:%.*]], align 8
565-
; AVX2-NEXT: ret void
540+
; CHECK-LABEL: @PR47558_multiple_use_load(
541+
; CHECK-NEXT: [[SCALEPTR:%.*]] = tail call nonnull align 16 dereferenceable(64) ptr @getscaleptr()
542+
; CHECK-NEXT: [[OP:%.*]] = load <2 x float>, ptr [[OPPTR:%.*]], align 4
543+
; CHECK-NEXT: [[SCALE:%.*]] = load float, ptr [[SCALEPTR]], align 16
544+
; CHECK-NEXT: [[T1:%.*]] = insertelement <2 x float> poison, float [[SCALE]], i32 0
545+
; CHECK-NEXT: [[T2:%.*]] = insertelement <2 x float> [[T1]], float [[SCALE]], i32 1
546+
; CHECK-NEXT: [[T3:%.*]] = fmul <2 x float> [[OP]], [[T2]]
547+
; CHECK-NEXT: [[T4:%.*]] = extractelement <2 x float> [[T3]], i32 0
548+
; CHECK-NEXT: [[RESULT0:%.*]] = insertelement <2 x float> poison, float [[T4]], i32 0
549+
; CHECK-NEXT: [[RESULT1:%.*]] = shufflevector <2 x float> [[RESULT0]], <2 x float> [[T3]], <2 x i32> <i32 0, i32 3>
550+
; CHECK-NEXT: store <2 x float> [[RESULT1]], ptr [[RESULTPTR:%.*]], align 8
551+
; CHECK-NEXT: ret void
566552
;
567553
%scaleptr = tail call nonnull align 16 dereferenceable(64) ptr @getscaleptr()
568554
%op = load <2 x float>, ptr %opptr, align 4

llvm/test/Transforms/VectorCombine/X86/load.ll

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -520,32 +520,18 @@ define <2 x float> @load_f32_insert_v2f32_asan(ptr align 16 dereferenceable(16)
520520

521521
declare ptr @getscaleptr()
522522
define void @PR47558_multiple_use_load(ptr nocapture nonnull %resultptr, ptr nocapture nonnull readonly %opptr) {
523-
; SSE2-LABEL: @PR47558_multiple_use_load(
524-
; SSE2-NEXT: [[SCALEPTR:%.*]] = tail call nonnull align 16 dereferenceable(64) ptr @getscaleptr()
525-
; SSE2-NEXT: [[OP:%.*]] = load <2 x float>, ptr [[OPPTR:%.*]], align 4
526-
; SSE2-NEXT: [[SCALE:%.*]] = load float, ptr [[SCALEPTR]], align 16
527-
; SSE2-NEXT: [[T1:%.*]] = insertelement <2 x float> undef, float [[SCALE]], i32 0
528-
; SSE2-NEXT: [[T2:%.*]] = insertelement <2 x float> [[T1]], float [[SCALE]], i32 1
529-
; SSE2-NEXT: [[T3:%.*]] = fmul <2 x float> [[OP]], [[T2]]
530-
; SSE2-NEXT: [[T4:%.*]] = extractelement <2 x float> [[T3]], i32 0
531-
; SSE2-NEXT: [[RESULT0:%.*]] = insertelement <2 x float> undef, float [[T4]], i32 0
532-
; SSE2-NEXT: [[T5:%.*]] = extractelement <2 x float> [[T3]], i32 1
533-
; SSE2-NEXT: [[RESULT1:%.*]] = insertelement <2 x float> [[RESULT0]], float [[T5]], i32 1
534-
; SSE2-NEXT: store <2 x float> [[RESULT1]], ptr [[RESULTPTR:%.*]], align 8
535-
; SSE2-NEXT: ret void
536-
;
537-
; AVX2-LABEL: @PR47558_multiple_use_load(
538-
; AVX2-NEXT: [[SCALEPTR:%.*]] = tail call nonnull align 16 dereferenceable(64) ptr @getscaleptr()
539-
; AVX2-NEXT: [[OP:%.*]] = load <2 x float>, ptr [[OPPTR:%.*]], align 4
540-
; AVX2-NEXT: [[SCALE:%.*]] = load float, ptr [[SCALEPTR]], align 16
541-
; AVX2-NEXT: [[T1:%.*]] = insertelement <2 x float> undef, float [[SCALE]], i32 0
542-
; AVX2-NEXT: [[T2:%.*]] = insertelement <2 x float> [[T1]], float [[SCALE]], i32 1
543-
; AVX2-NEXT: [[T3:%.*]] = fmul <2 x float> [[OP]], [[T2]]
544-
; AVX2-NEXT: [[T4:%.*]] = extractelement <2 x float> [[T3]], i32 0
545-
; AVX2-NEXT: [[RESULT0:%.*]] = insertelement <2 x float> undef, float [[T4]], i32 0
546-
; AVX2-NEXT: [[RESULT1:%.*]] = shufflevector <2 x float> [[RESULT0]], <2 x float> [[T3]], <2 x i32> <i32 0, i32 3>
547-
; AVX2-NEXT: store <2 x float> [[RESULT1]], ptr [[RESULTPTR:%.*]], align 8
548-
; AVX2-NEXT: ret void
523+
; CHECK-LABEL: @PR47558_multiple_use_load(
524+
; CHECK-NEXT: [[SCALEPTR:%.*]] = tail call nonnull align 16 dereferenceable(64) ptr @getscaleptr()
525+
; CHECK-NEXT: [[OP:%.*]] = load <2 x float>, ptr [[OPPTR:%.*]], align 4
526+
; CHECK-NEXT: [[SCALE:%.*]] = load float, ptr [[SCALEPTR]], align 16
527+
; CHECK-NEXT: [[T1:%.*]] = insertelement <2 x float> undef, float [[SCALE]], i32 0
528+
; CHECK-NEXT: [[T2:%.*]] = insertelement <2 x float> [[T1]], float [[SCALE]], i32 1
529+
; CHECK-NEXT: [[T3:%.*]] = fmul <2 x float> [[OP]], [[T2]]
530+
; CHECK-NEXT: [[T4:%.*]] = extractelement <2 x float> [[T3]], i32 0
531+
; CHECK-NEXT: [[RESULT0:%.*]] = insertelement <2 x float> undef, float [[T4]], i32 0
532+
; CHECK-NEXT: [[RESULT1:%.*]] = shufflevector <2 x float> [[RESULT0]], <2 x float> [[T3]], <2 x i32> <i32 0, i32 3>
533+
; CHECK-NEXT: store <2 x float> [[RESULT1]], ptr [[RESULTPTR:%.*]], align 8
534+
; CHECK-NEXT: ret void
549535
;
550536
%scaleptr = tail call nonnull align 16 dereferenceable(64) ptr @getscaleptr()
551537
%op = load <2 x float>, ptr %opptr, align 4

0 commit comments

Comments
 (0)