1; RUN: opt -gvn -S -o - %s | FileCheck %s 2 3; If a branch has two identical successors, we cannot declare either dead. 4 5define void @widget(i1 %p) { 6entry: 7 br label %bb2 8 9bb2: 10 %t1 = phi i64 [ 0, %entry ], [ %t5, %bb7 ] 11 %t2 = add i64 %t1, 1 12 %t3 = icmp ult i64 0, %t2 13 br i1 %t3, label %bb3, label %bb4 14 15bb3: 16 %t4 = call i64 @f() 17 br label %bb4 18 19bb4: 20 ; CHECK-NOT: phi {{.*}} undef 21 %foo = phi i64 [ %t4, %bb3 ], [ 0, %bb2 ] 22 br i1 %p, label %bb5, label %bb6 23 24bb5: 25 br i1 true, label %bb7, label %bb7 26 27bb6: 28 br i1 true, label %bb7, label %bb7 29 30bb7: 31 %t5 = add i64 %t1, 1 32 br i1 %p, label %bb2, label %bb8 33 34bb8: 35 ret void 36} 37 38declare i64 @f() 39