22 lines · plain
1; RUN: opt < %s -loop-reduce -S | grep phi | count 12 3define void @foo(i32 %n) {4entry:5 br label %loop6 7loop:8 %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]9 10 ; These three instructions form an isolated cycle and can be deleted.11 %j = phi i32 [ 0, %entry ], [ %j.y, %loop ]12 %j.x = add i32 %j, 113 %j.y = mul i32 %j.x, 214 15 %i.next = add i32 %i, 116 %c = icmp ne i32 %i.next, %n17 br i1 %c, label %loop, label %exit18 19exit:20 ret void21}22