1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=loop-unroll -S < %s | FileCheck %s
4 ; Can't recursively delete %c.addr.07 without deleting %conv1
5 ; and thus invalidating iteration.
6 define void @PR50368(i32 %c, i64 %x) {
7 ; CHECK-LABEL: @PR50368(
9 ; CHECK-NEXT: br label [[LOOP_PEEL_BEGIN:%.*]]
10 ; CHECK: loop.peel.begin:
11 ; CHECK-NEXT: br label [[LOOP_PEEL:%.*]]
13 ; CHECK-NEXT: br i1 false, label [[EXIT:%.*]], label [[LOOP_PEEL_NEXT:%.*]]
14 ; CHECK: loop.peel.next:
15 ; CHECK-NEXT: br label [[LOOP_PEEL_NEXT1:%.*]]
16 ; CHECK: loop.peel.next1:
17 ; CHECK-NEXT: br label [[ENTRY_PEEL_NEWPH:%.*]]
18 ; CHECK: entry.peel.newph:
19 ; CHECK-NEXT: br label [[LOOP:%.*]]
21 ; CHECK-NEXT: br i1 false, label [[EXIT_LOOPEXIT:%.*]], label [[LOOP]], !llvm.loop [[LOOP0:![0-9]+]]
22 ; CHECK: exit.loopexit:
23 ; CHECK-NEXT: br label [[EXIT]]
25 ; CHECK-NEXT: ret void
31 %0 = phi i64 [ 0, %loop ], [ %x, %entry ]
32 %c.addr.07 = phi i32 [ %conv1, %loop ], [ %c, %entry ]
33 %conv1 = trunc i64 undef to i32
34 br i1 false, label %exit, label %loop
41 define void @dead_chain(i64 %a) {
42 ; CHECK-LABEL: @dead_chain(
44 ; CHECK-NEXT: br label [[LOOP:%.*]]
46 ; CHECK-NEXT: ret void
52 %conv1 = trunc i64 %a to i32
53 %and = and i32 %conv1, 15
54 %shl = shl i32 %and, 15
55 br i1 true, label %exit, label %loop