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