1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=loop-simplify -S | FileCheck %s
4 ; Tests loop-simplify does not move the loop metadata, because
5 ; the loopexit block is not the latch of the loop _bb6.
7 define void @func(i1 %p) {
10 ; CHECK-NEXT: br label [[LOOP_HEADER:%.*]]
11 ; CHECK: loop.header.loopexit:
12 ; CHECK-NEXT: br label [[LOOP_HEADER]], !llvm.loop [[LOOP0:![0-9]+]]
14 ; CHECK-NEXT: br i1 [[P:%.*]], label [[BB1:%.*]], label [[EXIT:%.*]]
16 ; CHECK-NEXT: br i1 [[P]], label [[BB2:%.*]], label [[BB3:%.*]]
18 ; CHECK-NEXT: br label [[BB3]]
20 ; CHECK-NEXT: br label [[LOOP_LATCH:%.*]]
22 ; CHECK-NEXT: br i1 [[P]], label [[LOOP_LATCH]], label [[LOOP_HEADER_LOOPEXIT:%.*]], !llvm.loop [[LOOP0]]
24 ; CHECK-NEXT: ret void
30 br i1 %p, label %bb1, label %exit
33 br i1 %p, label %bb2, label %bb3
42 br i1 %p, label %loop.latch, label %loop.header, !llvm.loop !0
48 !0 = distinct !{!0, !1}
49 !1 = !{!"llvm.loop.mustprogress"}