1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=indvars < %s | FileCheck %s
4 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
6 define void @test(i1 %arg) {
9 ; CHECK-NEXT: br label [[BB2:%.*]]
11 ; CHECK-NEXT: br label [[BB2]]
13 ; CHECK-NEXT: [[TMP:%.*]] = phi i32 [ -9, [[BB:%.*]] ], [ [[TMP6:%.*]], [[BB1:%.*]] ]
14 ; CHECK-NEXT: br label [[BB3:%.*]]
16 ; CHECK-NEXT: [[TMP4:%.*]] = phi i32 [ -9, [[BB2]] ], [ [[TMP6]], [[BB10:%.*]] ]
17 ; CHECK-NEXT: br i1 [[ARG:%.*]], label [[BB5:%.*]], label [[BB12:%.*]]
19 ; CHECK-NEXT: [[TMP6]] = add i32 [[TMP4]], -1
20 ; CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
21 ; CHECK-NEXT: br i1 [[ARG]], label [[BB8:%.*]], label [[BB9:%.*]]
23 ; CHECK-NEXT: br label [[BB10]]
25 ; CHECK-NEXT: br label [[BB10]]
27 ; CHECK-NEXT: [[TMP11:%.*]] = and i64 undef, [[TMP7]]
28 ; CHECK-NEXT: br label [[BB3]]
30 ; CHECK-NEXT: ret void
36 bb1: ; No predecessors!
39 bb2: ; preds = %bb1, %bb
40 %tmp = phi i32 [ -9, %bb ], [ %tmp6, %bb1 ]
43 bb3: ; preds = %bb10, %bb2
44 %tmp4 = phi i32 [ -9, %bb2 ], [ %tmp6, %bb10 ]
45 br i1 %arg, label %bb5, label %bb12
48 %tmp6 = add i32 %tmp4, -1
49 %tmp7 = zext i32 %tmp6 to i64
50 br i1 %arg, label %bb8, label %bb9
58 bb10: ; preds = %bb9, %bb8
59 %tmp11 = and i64 undef, %tmp7