1 ; RUN: opt < %s -lcssa -S | FileCheck %s 2 ; RUN: opt < %s -passes=lcssa -S | FileCheck %s 3 ; CHECK: exit1: 4 ; CHECK: .lcssa = 5 ; CHECK: exit2: 6 ; CHECK: .lcssa1 = 7 ; CHECK: exit3: 8 ; CHECK-NOT: .lcssa 9 10 ; Test to ensure that when there are multiple exit blocks, PHI nodes are 11 ; only inserted by LCSSA when there is a use dominated by a given exit 12 ; block. 13 14 declare void @printf(i32 %i) 15 16 define i32 @unused_phis() nounwind { 17 entry: 18 br label %loop 19 20 loop: 21 %i = phi i32 [0, %entry], [1, %then2] 22 br i1 undef, label %exit1, label %then1 23 24 then1: 25 br i1 undef, label %exit2, label %then2 26 27 then2: 28 br i1 undef, label %exit3, label %loop 29 30 exit1: 31 call void @printf(i32 %i) 32 ret i32 %i 33 34 exit2: 35 ret i32 %i 36 37 exit3: 38 ret i32 0 39 } 40