1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2 ; RUN: opt -S -passes=indvars < %s | FileCheck %s
5 ; CHECK-LABEL: define i32 @widget() {
6 ; CHECK-NEXT: [[B:.*:]]
7 ; CHECK-NEXT: br label %[[B1:.*]]
9 ; CHECK-NEXT: br i1 true, label %[[B3:.*]], label %[[B8:.*]]
11 ; CHECK-NEXT: br i1 true, label %[[B7:.*]], label %[[B5:.*]]
13 ; CHECK-NEXT: br label %[[B1]]
15 ; CHECK-NEXT: ret i32 5
17 ; CHECK-NEXT: ret i32 7
23 %phi = phi i32 [ 0, %b ], [ %udiv6, %b5 ]
24 %phi2 = phi i32 [ 1, %b ], [ %add, %b5 ]
25 %icmp = icmp eq i32 %phi, 0
26 br i1 %icmp, label %b3, label %b8
29 %udiv = udiv i32 10, %phi2
30 %urem = urem i32 %udiv, 10
31 %icmp4 = icmp eq i32 %urem, 0
32 br i1 %icmp4, label %b7, label %b5
35 %udiv6 = udiv i32 %phi2, 0
36 %add = add i32 %phi2, 1