Skip to content

Commit c539718

Browse files
committed
Add store
1 parent 20ac962 commit c539718

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

llvm/test/Transforms/LoopVectorize/predicate-switch.ll

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,8 @@ define void @switch_unconditional(ptr %start) {
500500
; IC1-NEXT: br label %[[VECTOR_BODY:.*]]
501501
; IC1: [[VECTOR_BODY]]:
502502
; IC1-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
503+
; IC1-NEXT: [[TMP1:%.*]] = getelementptr i32, ptr [[START]], i64 [[INDEX]]
504+
; IC1-NEXT: store <2 x i32> zeroinitializer, ptr [[TMP1]], align 4
503505
; IC1-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 2
504506
; IC1-NEXT: [[TMP0:%.*]] = icmp eq i64 [[INDEX_NEXT]], 100
505507
; IC1-NEXT: br i1 [[TMP0]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP6:![0-9]+]]
@@ -516,6 +518,7 @@ define void @switch_unconditional(ptr %start) {
516518
; IC1: [[FOO]]:
517519
; IC1-NEXT: br label %[[LATCH]]
518520
; IC1: [[LATCH]]:
521+
; IC1-NEXT: store i32 0, ptr [[GEP]], align 4
519522
; IC1-NEXT: [[IV_NEXT]] = add i64 [[IV]], 1
520523
; IC1-NEXT: [[CMP:%.*]] = icmp eq i64 [[IV_NEXT]], 100
521524
; IC1-NEXT: br i1 [[CMP]], label %[[EXIT]], label %[[LOOP]], !llvm.loop [[LOOP7:![0-9]+]]
@@ -530,6 +533,10 @@ define void @switch_unconditional(ptr %start) {
530533
; IC2-NEXT: br label %[[VECTOR_BODY:.*]]
531534
; IC2: [[VECTOR_BODY]]:
532535
; IC2-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
536+
; IC2-NEXT: [[TMP2:%.*]] = getelementptr i32, ptr [[START]], i64 [[INDEX]]
537+
; IC2-NEXT: [[TMP1:%.*]] = getelementptr i32, ptr [[TMP2]], i32 2
538+
; IC2-NEXT: store <2 x i32> zeroinitializer, ptr [[TMP2]], align 4
539+
; IC2-NEXT: store <2 x i32> zeroinitializer, ptr [[TMP1]], align 4
533540
; IC2-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
534541
; IC2-NEXT: [[TMP0:%.*]] = icmp eq i64 [[INDEX_NEXT]], 100
535542
; IC2-NEXT: br i1 [[TMP0]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP6:![0-9]+]]
@@ -546,6 +553,7 @@ define void @switch_unconditional(ptr %start) {
546553
; IC2: [[FOO]]:
547554
; IC2-NEXT: br label %[[LATCH]]
548555
; IC2: [[LATCH]]:
556+
; IC2-NEXT: store i32 0, ptr [[GEP]], align 4
549557
; IC2-NEXT: [[IV_NEXT]] = add i64 [[IV]], 1
550558
; IC2-NEXT: [[CMP:%.*]] = icmp eq i64 [[IV_NEXT]], 100
551559
; IC2-NEXT: br i1 [[CMP]], label %[[EXIT]], label %[[LOOP]], !llvm.loop [[LOOP7:![0-9]+]]
@@ -565,6 +573,7 @@ foo:
565573
br label %latch
566574

567575
latch:
576+
store i32 0, ptr %gep
568577
%iv.next = add i64 %iv, 1
569578
%cmp = icmp eq i64 %iv.next, 100
570579
br i1 %cmp, label %exit, label %loop

0 commit comments

Comments
 (0)