71aa5a04881e88f60a2e64c2d421ee10724defa4
[oota-llvm.git] / test / CodeGen / X86 / pr3495-2.ll
1 ; RUN: llc < %s -march=x86 -relocation-model=pic -disable-fp-elim -stats |& grep {Number of reloads omited}
2
3 target datalayout = "e-p:32:32:32"
4 target triple = "i386-apple-darwin9.6"
5         %struct.constraintVCGType = type { i32, i32, i32, i32 }
6         %struct.nodeVCGType = type { %struct.constraintVCGType*, i32, i32, i32, %struct.constraintVCGType*, i32, i32, i32 }
7
8 define fastcc void @SCC_DFSBelowVCG(%struct.nodeVCGType* %VCG, i32 %net, i32 %label) nounwind {
9 entry:
10         %0 = getelementptr %struct.nodeVCGType* %VCG, i32 %net, i32 5           ; <i32*> [#uses=2]
11         %1 = load i32* %0, align 4              ; <i32> [#uses=1]
12         %2 = icmp eq i32 %1, 0          ; <i1> [#uses=1]
13         br i1 %2, label %bb5, label %bb.nph3
14
15 bb.nph3:                ; preds = %entry
16         %3 = getelementptr %struct.nodeVCGType* %VCG, i32 %net, i32 4           ; <%struct.constraintVCGType**> [#uses=1]
17         br label %bb
18
19 bb:             ; preds = %bb3, %bb.nph3
20         %s.02 = phi i32 [ 0, %bb.nph3 ], [ %12, %bb3 ]          ; <i32> [#uses=2]
21         %4 = load %struct.constraintVCGType** %3, align 4               ; <%struct.constraintVCGType*> [#uses=1]
22         %5 = icmp eq i32 0, 0           ; <i1> [#uses=1]
23         br i1 %5, label %bb1, label %bb3
24
25 bb1:            ; preds = %bb
26         %6 = getelementptr %struct.constraintVCGType* %4, i32 %s.02, i32 0              ; <i32*> [#uses=1]
27         %7 = load i32* %6, align 4              ; <i32> [#uses=2]
28         %8 = getelementptr %struct.nodeVCGType* %VCG, i32 %7, i32 7             ; <i32*> [#uses=1]
29         %9 = load i32* %8, align 4              ; <i32> [#uses=1]
30         %10 = icmp eq i32 %9, 0         ; <i1> [#uses=1]
31         br i1 %10, label %bb2, label %bb3
32
33 bb2:            ; preds = %bb1
34         %11 = getelementptr %struct.nodeVCGType* %VCG, i32 %7, i32 4            ; <%struct.constraintVCGType**> [#uses=0]
35         br label %bb.i
36
37 bb.i:           ; preds = %bb.i, %bb2
38         br label %bb.i
39
40 bb3:            ; preds = %bb1, %bb
41         %12 = add i32 %s.02, 1          ; <i32> [#uses=2]
42         %13 = load i32* %0, align 4             ; <i32> [#uses=1]
43         %14 = icmp ugt i32 %13, %12             ; <i1> [#uses=1]
44         br i1 %14, label %bb, label %bb5
45
46 bb5:            ; preds = %bb3, %entry
47         %15 = getelementptr %struct.nodeVCGType* %VCG, i32 %net, i32 6          ; <i32*> [#uses=1]
48         store i32 %label, i32* %15, align 4
49         ret void
50 }