OLD | NEW |
1 ; This tests a simple loop that sums the elements of an input array. | 1 ; This tests a simple loop that sums the elements of an input array. |
2 ; The O2 check patterns represent the best code currently achieved. | 2 ; The O2 check patterns represent the best code currently achieved. |
3 | 3 |
4 ; RUN: %p2i -i %s --args -O2 --verbose none \ | 4 ; RUN: %p2i -i %s --args -O2 --verbose none \ |
5 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ | 5 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ |
6 ; RUN: | llvm-objdump -d -symbolize -x86-asm-syntax=intel - | FileCheck %s | 6 ; RUN: | llvm-objdump -d -symbolize -x86-asm-syntax=intel - | FileCheck %s |
7 ; RUN: %p2i -i %s --args -Om1 --verbose none \ | 7 ; RUN: %p2i -i %s --args -Om1 --verbose none \ |
8 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ | 8 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ |
9 ; RUN: | llvm-objdump -d -symbolize -x86-asm-syntax=intel - \ | 9 ; RUN: | llvm-objdump -d -symbolize -x86-asm-syntax=intel - \ |
10 ; RUN: | FileCheck --check-prefix=OPTM1 %s | 10 ; RUN: | FileCheck --check-prefix=OPTM1 %s |
11 ; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s | 11 ; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s |
12 ; TODO(kschimpf) Find out why lc2i is needed, and fix. | |
13 ; RUN: %lc2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s | |
14 | 12 |
15 define i32 @simple_loop(i32 %a, i32 %n) { | 13 define i32 @simple_loop(i32 %a, i32 %n) { |
16 entry: | 14 entry: |
17 %cmp4 = icmp sgt i32 %n, 0 | 15 %cmp4 = icmp sgt i32 %n, 0 |
18 br i1 %cmp4, label %for.body, label %for.end | 16 br i1 %cmp4, label %for.body, label %for.end |
19 | 17 |
20 for.body: | 18 for.body: |
21 %i.06 = phi i32 [ %inc, %for.body ], [ 0, %entry ] | 19 %i.06 = phi i32 [ %inc, %for.body ], [ 0, %entry ] |
22 %sum.05 = phi i32 [ %add, %for.body ], [ 0, %entry ] | 20 %sum.05 = phi i32 [ %add, %for.body ], [ 0, %entry ] |
23 %gep_array = mul i32 %i.06, 4 | 21 %gep_array = mul i32 %i.06, 4 |
(...skipping 26 matching lines...) Expand all Loading... |
50 ; CHECK-NEXT: jl -{{[0-9]}} | 48 ; CHECK-NEXT: jl -{{[0-9]}} |
51 ; | 49 ; |
52 ; There's nothing remarkable under Om1 to test for, since Om1 generates | 50 ; There's nothing remarkable under Om1 to test for, since Om1 generates |
53 ; such atrocious code (by design). | 51 ; such atrocious code (by design). |
54 ; OPTM1-LABEL: simple_loop | 52 ; OPTM1-LABEL: simple_loop |
55 ; OPTM1: cmp {{.*}}, 0 | 53 ; OPTM1: cmp {{.*}}, 0 |
56 ; OPTM1: jg | 54 ; OPTM1: jg |
57 ; OPTM1: ret | 55 ; OPTM1: ret |
58 | 56 |
59 ; ERRORS-NOT: ICE translation error | 57 ; ERRORS-NOT: ICE translation error |
60 ; DUMP-NOT: SZ | |
OLD | NEW |