3 ; RUN: opt -newgvn -S %s | FileCheck %s
7 ; TODO: Currently NewGVN crashes on the function below, see PR42422.
13 for.cond: ; preds = %cleanup20, %entry
16 for.cond1: ; preds = %for.inc17, %for.cond
17 %0 = phi i32 [ %inc18, %for.inc17 ], [ 0, %for.cond ]
18 %cmp = icmp sle i32 %0, 1
19 br i1 %cmp, label %for.body, label %for.end19
21 for.body: ; preds = %for.cond1
22 br i1 undef, label %for.body3, label %for.body.for.cond4_crit_edge
24 for.body.for.cond4_crit_edge: ; preds = %for.body
27 for.body3: ; preds = %for.body
30 for.cond4: ; preds = %cleanup, %for.body.for.cond4_crit_edge
31 br i1 undef, label %if.then, label %if.end
33 if.then: ; preds = %for.cond4
36 if.end: ; preds = %for.cond4
39 for.cond6: ; preds = %for.inc, %if.end
40 %1 = phi i64 [ %inc, %for.inc ], [ 0, %if.end ]
41 %cmp7 = icmp sle i64 %1, 1
42 br i1 %cmp7, label %for.inc, label %for.end9
44 for.inc: ; preds = %for.cond6
45 %inc = add nsw i64 %1, 1
48 for.end9: ; preds = %for.cond6
49 br i1 true, label %if.then11, label %if.end12
51 if.then11: ; preds = %for.end9
54 if.end12: ; preds = %for.end9
57 cleanup: ; preds = %if.end12, %if.then11, %if.then
58 %cleanup.dest = phi i32 [ undef, %if.end12 ], [ 1, %if.then11 ], [ 9, %if.then ]
59 switch i32 %cleanup.dest, label %cleanup14 [
60 i32 0, label %for.cond4
61 i32 9, label %for.end13
64 for.end13: ; preds = %cleanup
67 cleanup14: ; preds = %for.end13, %cleanup, %for.body3
68 %cleanup.dest15 = phi i32 [ 0, %for.end13 ], [ %cleanup.dest, %cleanup ], [ 1, %for.body3 ]
69 %cond1 = icmp eq i32 %cleanup.dest15, 0
70 br i1 %cond1, label %for.inc17, label %cleanup20
72 for.inc17: ; preds = %cleanup14
73 %inc18 = add nsw i32 %0, 1
76 for.end19: ; preds = %for.cond1
79 cleanup20: ; preds = %for.end19, %cleanup14
80 %cleanup.dest21 = phi i32 [ %cleanup.dest15, %cleanup14 ], [ 0, %for.end19 ]
81 %cond = icmp eq i32 %cleanup.dest21, 0
82 br i1 %cond, label %for.cond, label %cleanup23
84 cleanup23: ; preds = %cleanup20