• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -indvars -loop-deletion -S | FileCheck %s
2
3define i32 @test(i32 %x_offs) nounwind readnone {
4; CHECK-LABEL: @test(
5; CHECK: phi
6; CHECK-NOT: phi
7
8entry:
9	%0 = icmp sgt i32 %x_offs, 4		; <i1> [#uses=1]
10	br i1 %0, label %bb.nph, label %bb2
11
12bb.nph:		; preds = %entry
13	br label %bb
14
15bb:		; preds = %bb1, %bb.nph
16	%x_offs_addr.01 = phi i32 [ %1, %bb1 ], [ %x_offs, %bb.nph ]		; <i32> [#uses=1]
17	%1 = add i32 %x_offs_addr.01, -4		; <i32> [#uses=3]
18	br label %bb1
19
20bb1:		; preds = %bb
21	%2 = icmp sgt i32 %1, 4		; <i1> [#uses=1]
22	br i1 %2, label %bb, label %bb1.bb2_crit_edge
23
24bb1.bb2_crit_edge:		; preds = %bb1
25	br label %bb2
26
27bb2:		; preds = %bb1.bb2_crit_edge, %entry
28	%x_offs_addr.0.lcssa = phi i32 [ %1, %bb1.bb2_crit_edge ], [ %x_offs, %entry ]		; <i32> [#uses=1]
29	ret i32 %x_offs_addr.0.lcssa
30}
31