1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py 2; RUN: opt -S -loop-simplifycfg -verify-scev < %s | FileCheck %s 3 4; Verify that the scev information is still valid. Verification should not fail 5 6define void @t_run_test() { 7; CHECK-LABEL: @t_run_test( 8; CHECK-NEXT: entry: 9; CHECK-NEXT: br label %[[LOOP_PH:.*]] 10; CHECK: [[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:.*]] 17; CHECK: [[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:.*]] 24; CHECK: [[EXIT2]]: 25; CHECK-NEXT: ret void 26; 27entry: 28 br label %loop.ph 29 30loop.ph: 31 br label %loop.header 32 33loop.header: 34 %iv = phi i32 [0, %loop.ph], [%inc, %loop.body] 35 br label %loop.body1 36 37loop.body1: 38 br label %loop.body 39 40loop.body: 41 %inc = add i32 %iv, 1 42 %cmp = icmp ult i32 %inc, 10 43 br i1 %cmp, label %loop.header, label %exit 44 45exit: 46 br label %loop.body2 47 48loop.body2: 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 53 54exit2: 55 ret void 56} 57 58