1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; Check that we're not crashing while looking at the recurrence variable.
3 ; RUN: opt -S -loop-idiom %s | FileCheck %s
5 define void @tinkywinky() {
6 ; CHECK-LABEL: @tinkywinky(
8 ; CHECK-NEXT: br i1 true, label [[EXIT:%.*]], label [[PH:%.*]]
10 ; CHECK-NEXT: [[MYPHI:%.*]] = phi i32 [ 1, [[ENTRY:%.*]] ]
11 ; CHECK-NEXT: br label [[IF_END:%.*]]
13 ; CHECK-NEXT: [[PATATINO:%.*]] = ashr i32 [[MYPHI]], undef
14 ; CHECK-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[PATATINO]], 0
15 ; CHECK-NEXT: br i1 [[TOBOOL]], label [[EXIT_LOOPEXIT:%.*]], label [[IF_END]]
16 ; CHECK: exit.loopexit:
17 ; CHECK-NEXT: br label [[EXIT]]
19 ; CHECK-NEXT: ret void
22 br i1 true, label %exit, label %ph
25 %myphi = phi i32 [ 1, %entry ]
29 %patatino = ashr i32 %myphi, undef
30 %tobool = icmp eq i32 %patatino, 0
31 br i1 %tobool, label %exit, label %if.end