Merging r261039:
[oota-llvm.git] / test / CodeGen / X86 / full-lsr.ll
1 ; RUN: llc < %s -march=x86 -mcpu=generic | FileCheck %s
2 ; RUN: llc < %s -march=x86 -mcpu=atom | FileCheck -check-prefix=ATOM %s
3
4 define void @foo(float* nocapture %A, float* nocapture %B, float* nocapture %C, i32 %N) nounwind {
5 ; ATOM: foo
6 ; ATOM: addl
7 ; ATOM: addl
8 ; ATOM: leal
9
10 ; CHECK: foo
11 ; CHECK: addl
12 ; CHECK: addl
13 ; CHECK: addl
14
15 entry:
16         %0 = icmp sgt i32 %N, 0         ; <i1> [#uses=1]
17         br i1 %0, label %bb, label %return
18
19 bb:             ; preds = %bb, %entry
20         %i.03 = phi i32 [ 0, %entry ], [ %indvar.next, %bb ]            ; <i32> [#uses=5]
21         %1 = getelementptr float, float* %A, i32 %i.03          ; <float*> [#uses=1]
22         %2 = load float, float* %1, align 4             ; <float> [#uses=1]
23         %3 = getelementptr float, float* %B, i32 %i.03          ; <float*> [#uses=1]
24         %4 = load float, float* %3, align 4             ; <float> [#uses=1]
25         %5 = fadd float %2, %4          ; <float> [#uses=1]
26         %6 = getelementptr float, float* %C, i32 %i.03          ; <float*> [#uses=1]
27         store float %5, float* %6, align 4
28         %7 = add i32 %i.03, 10          ; <i32> [#uses=3]
29         %8 = getelementptr float, float* %A, i32 %7             ; <float*> [#uses=1]
30         %9 = load float, float* %8, align 4             ; <float> [#uses=1]
31         %10 = getelementptr float, float* %B, i32 %7            ; <float*> [#uses=1]
32         %11 = load float, float* %10, align 4           ; <float> [#uses=1]
33         %12 = fadd float %9, %11                ; <float> [#uses=1]
34         %13 = getelementptr float, float* %C, i32 %7            ; <float*> [#uses=1]
35         store float %12, float* %13, align 4
36         %indvar.next = add i32 %i.03, 1         ; <i32> [#uses=2]
37         %exitcond = icmp eq i32 %indvar.next, %N                ; <i1> [#uses=1]
38         br i1 %exitcond, label %return, label %bb
39
40 return:         ; preds = %bb, %entry
41         ret void
42 }