8d6bb0df1f6d07a64cd31460a1a8b7c6164d3db6
[oota-llvm.git] / test / CodeGen / X86 / 2008-02-22-ReMatBug.ll
1 ; RUN: llc < %s -march=x86 -stats |& grep {Number of re-materialization} | grep 3
2 ; rdar://5761454
3
4         %struct.quad_struct = type { i32, i32, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct* }
5
6 define  %struct.quad_struct* @MakeTree(i32 %size, i32 %center_x, i32 %center_y, i32 %lo_proc, i32 %hi_proc, %struct.quad_struct* %parent, i32 %ct, i32 %level) nounwind  {
7 entry:
8         br i1 true, label %bb43.i, label %bb.i
9
10 bb.i:           ; preds = %entry
11         ret %struct.quad_struct* null
12
13 bb43.i:         ; preds = %entry
14         br i1 true, label %CheckOutside.exit40.i, label %bb11.i38.i
15
16 bb11.i38.i:             ; preds = %bb43.i
17         ret %struct.quad_struct* null
18
19 CheckOutside.exit40.i:          ; preds = %bb43.i
20         br i1 true, label %CheckOutside.exit30.i, label %bb11.i28.i
21
22 bb11.i28.i:             ; preds = %CheckOutside.exit40.i
23         ret %struct.quad_struct* null
24
25 CheckOutside.exit30.i:          ; preds = %CheckOutside.exit40.i
26         br i1 true, label %CheckOutside.exit20.i, label %bb11.i18.i
27
28 bb11.i18.i:             ; preds = %CheckOutside.exit30.i
29         ret %struct.quad_struct* null
30
31 CheckOutside.exit20.i:          ; preds = %CheckOutside.exit30.i
32         br i1 true, label %bb34, label %bb11.i8.i
33
34 bb11.i8.i:              ; preds = %CheckOutside.exit20.i
35         ret %struct.quad_struct* null
36
37 bb34:           ; preds = %CheckOutside.exit20.i
38         %tmp15.reg2mem.0 = sdiv i32 %size, 2            ; <i32> [#uses=7]
39         %tmp85 = sub i32 %center_y, %tmp15.reg2mem.0            ; <i32> [#uses=2]
40         %tmp88 = sub i32 %center_x, %tmp15.reg2mem.0            ; <i32> [#uses=2]
41         %tmp92 = tail call  %struct.quad_struct* @MakeTree( i32 %tmp15.reg2mem.0, i32 %tmp88, i32 %tmp85, i32 0, i32 %hi_proc, %struct.quad_struct* null, i32 2, i32 0 ) nounwind               ; <%struct.quad_struct*> [#uses=0]
42         %tmp99 = add i32 0, %hi_proc            ; <i32> [#uses=1]
43         %tmp100 = sdiv i32 %tmp99, 2            ; <i32> [#uses=1]
44         %tmp110 = tail call  %struct.quad_struct* @MakeTree( i32 %tmp15.reg2mem.0, i32 0, i32 %tmp85, i32 0, i32 %tmp100, %struct.quad_struct* null, i32 3, i32 0 ) nounwind            ; <%struct.quad_struct*> [#uses=0]
45         %tmp122 = add i32 %tmp15.reg2mem.0, %center_y           ; <i32> [#uses=2]
46         %tmp129 = tail call  %struct.quad_struct* @MakeTree( i32 %tmp15.reg2mem.0, i32 0, i32 %tmp122, i32 0, i32 0, %struct.quad_struct* null, i32 1, i32 0 ) nounwind                 ; <%struct.quad_struct*> [#uses=0]
47         %tmp147 = tail call  %struct.quad_struct* @MakeTree( i32 %tmp15.reg2mem.0, i32 %tmp88, i32 %tmp122, i32 %lo_proc, i32 0, %struct.quad_struct* null, i32 0, i32 0 ) nounwind             ; <%struct.quad_struct*> [#uses=0]
48         unreachable
49 }