1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -newgvn %s -S | FileCheck %s
4 @b = external global i32, align 4
5 @a = external global i32, align 4
6 define void @tinkywinky() {
7 ; CHECK-LABEL: @tinkywinky(
9 ; CHECK-NEXT: br label [[L1:%.*]]
11 ; CHECK-NEXT: br label [[L1]]
13 ; CHECK-NEXT: [[F_0:%.*]] = phi i32* [ @b, [[ENTRY:%.*]] ], [ @a, [[L1_LOOPEXIT:%.*]] ]
14 ; CHECK-NEXT: br label [[FOR_COND:%.*]]
15 ; CHECK: for.cond.loopexit:
16 ; CHECK-NEXT: store i8 undef, i8* null
17 ; CHECK-NEXT: br label [[FOR_COND]]
19 ; CHECK-NEXT: br i1 undef, label [[FOR_END14:%.*]], label [[FOR_COND1_PREHEADER:%.*]]
20 ; CHECK: for.cond1.preheader:
21 ; CHECK-NEXT: br label [[FOR_BODY3:%.*]]
23 ; CHECK-NEXT: br label [[L2:%.*]]
25 ; CHECK-NEXT: br i1 undef, label [[FOR_COND1:%.*]], label [[L1_LOOPEXIT]]
27 ; CHECK-NEXT: [[G_4:%.*]] = phi i32* [ @b, [[FOR_END14]] ], [ @a, [[FOR_COND1]] ]
28 ; CHECK-NEXT: [[F_2:%.*]] = phi i32* [ [[F_0]], [[FOR_END14]] ], [ @a, [[FOR_COND1]] ]
29 ; CHECK-NEXT: br label [[FOR_INC:%.*]]
31 ; CHECK-NEXT: br i1 false, label [[FOR_COND_LOOPEXIT:%.*]], label [[FOR_INC]]
33 ; CHECK-NEXT: br label [[L2]]
38 %g.223.lcssa = phi i32* [ @b, %for.body3 ]
41 %g.0 = phi i32* [ undef, %entry ], [ %g.223.lcssa, %l1.loopexit ]
42 %f.0 = phi i32* [ @b, %entry ], [ @a, %l1.loopexit ]
47 %g.1 = phi i32* [ %g.0, %l1 ], [ %g.4, %for.cond.loopexit ]
48 %f.1 = phi i32* [ %f.0, %l1 ], [ %f.2, %for.cond.loopexit ]
49 br i1 undef, label %for.end14, label %for.cond1.preheader
55 br i1 undef, label %for.cond1, label %l1.loopexit
57 %g.4 = phi i32* [ %g.1, %for.end14 ], [ @a, %for.cond1 ]
58 %f.2 = phi i32* [ %f.1, %for.end14 ], [ @a, %for.cond1 ]
61 br i1 false, label %for.cond.loopexit, label %for.inc