1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ;RUN: opt -passes=mem2reg -S < %s | FileCheck %s
9 ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond()
10 ; CHECK-NEXT: br i1 [[C1]], label [[STORE1:%.*]], label [[STORE2:%.*]]
12 ; CHECK-NEXT: br label [[JOIN:%.*]]
14 ; CHECK-NEXT: br label [[JOIN]]
16 ; CHECK-NEXT: br label [[JOIN]]
18 ; CHECK-NEXT: br label [[JOIN]]
20 ; CHECK-NEXT: br label [[JOIN]]
22 ; CHECK-NEXT: br label [[JOIN]]
24 ; CHECK-NEXT: br label [[JOIN]]
26 ; CHECK-NEXT: br label [[JOIN]]
28 ; CHECK-NEXT: br label [[JOIN]]
30 ; CHECK-NEXT: br label [[JOIN]]
32 ; CHECK-NEXT: br label [[JOIN]]
34 ; CHECK-NEXT: br label [[JOIN]]
36 ; CHECK-NEXT: br label [[JOIN]]
38 ; CHECK-NEXT: br label [[JOIN]]
40 ; CHECK-NEXT: br label [[JOIN]]
42 ; CHECK-NEXT: br label [[JOIN]]
44 ; CHECK-NEXT: br label [[JOIN]]
46 ; CHECK-NEXT: br label [[JOIN]]
48 ; CHECK-NEXT: [[VAL_0:%.*]] = phi i32 [ 1, [[STORE1]] ], [ 2, [[STORE2]] ], [ undef, [[BLOCK1:%.*]] ], [ undef, [[BLOCK2:%.*]] ], [ undef, [[BLOCK3:%.*]] ], [ undef, [[BLOCK4:%.*]] ], [ undef, [[BLOCK5:%.*]] ], [ undef, [[BLOCK6:%.*]] ], [ undef, [[BLOCK7:%.*]] ], [ undef, [[BLOCK8:%.*]] ], [ undef, [[BLOCK9:%.*]] ], [ undef, [[BLOCK10:%.*]] ], [ undef, [[BLOCK11:%.*]] ], [ undef, [[BLOCK12:%.*]] ], [ undef, [[BLOCK13:%.*]] ], [ undef, [[BLOCK14:%.*]] ], [ undef, [[BLOCK15:%.*]] ], [ undef, [[BLOCK16:%.*]] ]
49 ; CHECK-NEXT: ret i32 [[VAL_0]]
54 br i1 %c1, label %Store1, label %Store2
66 store i32 1, i32* %val
79 store i32 2, i32* %val
94 ; Phi inserted here should have operands appended deterministically
95 %result = load i32, i32* %val