1 ; RUN: opt -newgvn -S %s | FileCheck %s
4 ; CHECK-LABEL: define void @tinkywinky() {
6 ; CHECK-NEXT: br i1 undef, label %for.cond18, label %for.cond.preheader
7 ; CHECK: for.cond.preheader:
8 ; CHECK-NEXT: br label %for.cond2thread-pre-split
9 ; CHECK: for.cond2thread-pre-split:
10 ; CHECK-NEXT: %conv24 = phi i32 [ 0, %for.cond.preheader ], [ %conv, %for.inc.split ]
11 ; CHECK-NEXT: br label %for.inc.split
12 ; CHECK: for.inc.split:
13 ; CHECK-NEXT: %add = shl nsw i32 %conv24, 16
14 ; CHECK-NEXT: %sext23 = add i32 %add, 65536
15 ; CHECK-NEXT: %conv = ashr exact i32 %sext23, 16
16 ; CHECK-NEXT: %cmp = icmp slt i32 %sext23, 3604480
17 ; CHECK-NEXT: br i1 %cmp, label %for.cond2thread-pre-split, label %l1.loopexit
19 ; CHECK-NEXT: br label %l1
21 ; CHECK-NEXT: %0 = load i16, i16* null, align 2
22 ; CHECK-NEXT: %g.0.g.0..pr = load i16, i16* null, align 2
23 ; CHECK-NEXT: ret void
25 ; CHECK-NEXT: br label %l1
28 define void @tinkywinky() {
30 br i1 undef, label %for.cond18, label %for.cond.preheader
33 br label %for.cond2thread-pre-split
35 for.cond2thread-pre-split:
36 %conv24 = phi i32 [ 0, %for.cond.preheader ], [ %conv, %for.inc.split ]
37 br label %for.inc.split
40 %add = shl nsw i32 %conv24, 16
41 %sext23 = add i32 %add, 65536
42 %conv = ashr exact i32 %sext23, 16
43 %cmp = icmp slt i32 %sext23, 3604480
44 br i1 %cmp, label %for.cond2thread-pre-split, label %l1.loopexit
50 %h.0 = phi i16* [ undef, %for.cond18 ], [ null, %l1.loopexit ]
51 %0 = load i16, i16* %h.0, align 2
52 store i16 %0, i16* null, align 2
53 %g.0.g.0..pr = load i16, i16* null, align 2
54 %tobool15 = icmp eq i16 %g.0.g.0..pr, 0