1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=loop-simplifycfg -verify-scev -verify-memoryssa < %s | FileCheck %s
4 ; Verify that the scev information is still valid. Verification should not fail
6 define void @t_run_test() {
7 ; CHECK-LABEL: @t_run_test(
9 ; CHECK-NEXT: br label %[[LOOP_PH:.*]]
11 ; CHECK-NEXT: br label %[[LOOP_BODY:.*]]
12 ; CHECK: [[LOOP_BODY]]:
13 ; CHECK-NEXT: [[IV:%.*]] = phi i32 [ 0, %[[LOOP_PH]] ], [ [[INC:%.*]], %[[LOOP_BODY]] ]
14 ; CHECK-NEXT: [[INC]] = add i32 [[IV]], 1
15 ; CHECK-NEXT: [[CMP:%.*]] = icmp ult i32 [[INC]], 10
16 ; CHECK-NEXT: br i1 [[CMP]], label %[[LOOP_BODY]], label %[[EXIT:.*]]
18 ; CHECK-NEXT: br label %[[LOOP_BODY2:.*]]
19 ; CHECK: [[LOOP_BODY2]]:
20 ; CHECK-NEXT: [[IV2:%.*]] = phi i32 [ 0, %[[EXIT]] ], [ [[INC2:%.*]], %[[LOOP_BODY2]] ]
21 ; CHECK-NEXT: [[INC2]] = add i32 [[IV2]], 1
22 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i32 [[INC2]], 10
23 ; CHECK-NEXT: br i1 [[CMP2]], label %[[LOOP_BODY2]], label %[[EXIT2:.*]]
25 ; CHECK-NEXT: ret void
34 %iv = phi i32 [0, %loop.ph], [%inc, %loop.body]
42 %cmp = icmp ult i32 %inc, 10
43 br i1 %cmp, label %loop.header, label %exit
49 %iv2 = phi i32 [0, %exit], [%inc2, %loop.body2]
50 %inc2 = add i32 %iv2, 1
51 %cmp2 = icmp ult i32 %inc2, 10
52 br i1 %cmp2, label %loop.body2, label %exit2