Commit some changes I had managed to lose last night while refactoring the code....
[oota-llvm.git] / test / CodeGen / X86 / critical-edge-split.ll
1 ; RUN: llc < %s -mtriple=i386-apple-darwin -tailcallopt=false -stats -info-output-file - | grep asm-printer | grep 31
2
3         %CC = type { %Register }
4         %II = type { %"struct.XX::II::$_74" }
5         %JITFunction = type %YYValue* (%CC*, %YYValue**)
6         %YYValue = type { i32 (...)** }
7         %Register = type { %"struct.XX::ByteCodeFeatures" }
8         %"struct.XX::ByteCodeFeatures" = type { i32 }
9         %"struct.XX::II::$_74" = type { i8* }
10 @llvm.used = appending global [1 x i8*] [ i8* bitcast (%JITFunction* @loop to i8*) ], section "llvm.metadata"           ; <[1 x i8*]*> [#uses=0]
11
12 define %YYValue* @loop(%CC*, %YYValue**) nounwind {
13 ; <label>:2
14         %3 = getelementptr %CC* %0, i32 -9              ; <%CC*> [#uses=1]
15         %4 = bitcast %CC* %3 to %YYValue**              ; <%YYValue**> [#uses=2]
16         %5 = load %YYValue** %4         ; <%YYValue*> [#uses=3]
17         %unique_1.i = ptrtoint %YYValue* %5 to i1               ; <i1> [#uses=1]
18         br i1 %unique_1.i, label %loop, label %11
19
20 loop:           ; preds = %6, %2
21         %.1 = phi %YYValue* [ inttoptr (i32 1 to %YYValue*), %2 ], [ %intAddValue, %6 ]         ; <%YYValue*> [#uses=3]
22         %immediateCmp = icmp slt %YYValue* %.1, %5              ; <i1> [#uses=1]
23         br i1 %immediateCmp, label %6, label %8
24
25 ; <label>:6             ; preds = %loop
26         %lhsInt = ptrtoint %YYValue* %.1 to i32         ; <i32> [#uses=1]
27         %7 = call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %lhsInt, i32 2)          ; <{ i32, i1 }> [#uses=2]
28         %intAdd = extractvalue { i32, i1 } %7, 0                ; <i32> [#uses=1]
29         %intAddValue = inttoptr i32 %intAdd to %YYValue*                ; <%YYValue*> [#uses=1]
30         %intAddOverflow = extractvalue { i32, i1 } %7, 1                ; <i1> [#uses=1]
31         br i1 %intAddOverflow, label %.loopexit, label %loop
32
33 ; <label>:8             ; preds = %loop
34         ret %YYValue* inttoptr (i32 10 to %YYValue*)
35
36 .loopexit:              ; preds = %6
37         %9 = bitcast %CC* %0 to %YYValue**              ; <%YYValue**> [#uses=1]
38         store %YYValue* %.1, %YYValue** %9
39         store %YYValue* %5, %YYValue** %4
40         %10 = call fastcc %YYValue* @foobar(%II* inttoptr (i32 3431104 to %II*), %CC* %0, %YYValue** %1)                ; <%YYValue*> [#uses=1]
41         ret %YYValue* %10
42
43 ; <label>:11            ; preds = %2
44         %12 = call fastcc %YYValue* @foobar(%II* inttoptr (i32 3431080 to %II*), %CC* %0, %YYValue** %1)                ; <%YYValue*> [#uses=1]
45         ret %YYValue* %12
46 }
47
48 declare fastcc %YYValue* @foobar(%II*, %CC*, %YYValue**) nounwind
49
50 declare { i32, i1 } @llvm.sadd.with.overflow.i32(i32, i32) nounwind