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: %llvm2ice -O2 --verbose none %s \ | 4 ; RUN: %llvm2ice -O2 --verbose none %s \ |
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: %llvm2ice -Om1 --verbose none %s \ | 7 ; RUN: %llvm2ice -Om1 --verbose none %s \ |
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 |
(...skipping 20 matching lines...) Expand all Loading... |
31 br i1 %cmp, label %for.body, label %for.end | 31 br i1 %cmp, label %for.body, label %for.end |
32 | 32 |
33 for.end: | 33 for.end: |
34 %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ] | 34 %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ] |
35 ret i32 %sum.0.lcssa | 35 ret i32 %sum.0.lcssa |
36 } | 36 } |
37 | 37 |
38 ; CHECK-LABEL: simple_loop | 38 ; CHECK-LABEL: simple_loop |
39 ; CHECK: mov ecx, dword ptr [esp{{.*}}+{{.*}}{{[0-9]+}}] | 39 ; CHECK: mov ecx, dword ptr [esp{{.*}}+{{.*}}{{[0-9]+}}] |
40 ; CHECK: cmp ecx, 0 | 40 ; CHECK: cmp ecx, 0 |
41 ; CHECK-NEXT: jg {{[0-9]}} | 41 ; CHECK-NEXT: jle {{[0-9]}} |
42 ; NaCl bundle padding | 42 ; NaCl bundle padding |
43 ; CHECK-NEXT: nop | 43 ; CHECK-NEXT: nop |
44 ; CHECK-NEXT: jmp {{[0-9]}} | |
45 | 44 |
46 ; TODO: the mov from ebx to esi seems redundant here - so this may need to be | 45 ; TODO: the mov from ebx to esi seems redundant here - so this may need to be |
47 ; modified later | 46 ; modified later |
48 | 47 |
49 ; CHECK: add [[IREG:[a-z]+]], 1 | 48 ; CHECK: add [[IREG:[a-z]+]], 1 |
50 ; CHECK-NEXT: mov [[ICMPREG:[a-z]+]], [[IREG]] | 49 ; CHECK-NEXT: mov [[ICMPREG:[a-z]+]], [[IREG]] |
51 ; CHECK: cmp [[ICMPREG]], ecx | 50 ; CHECK: cmp [[ICMPREG]], ecx |
52 ; CHECK-NEXT: jl -{{[0-9]}} | 51 ; CHECK-NEXT: jl -{{[0-9]}} |
53 ; | 52 ; |
54 ; There's nothing remarkable under Om1 to test for, since Om1 generates | 53 ; There's nothing remarkable under Om1 to test for, since Om1 generates |
55 ; such atrocious code (by design). | 54 ; such atrocious code (by design). |
56 ; OPTM1-LABEL: simple_loop | 55 ; OPTM1-LABEL: simple_loop |
57 ; OPTM1: cmp {{.*}}, 0 | 56 ; OPTM1: cmp {{.*}}, 0 |
58 ; OPTM1: jg | 57 ; OPTM1: jg |
59 ; OPTM1: ret | 58 ; OPTM1: ret |
60 | 59 |
61 ; ERRORS-NOT: ICE translation error | 60 ; ERRORS-NOT: ICE translation error |
62 ; DUMP-NOT: SZ | 61 ; DUMP-NOT: SZ |
OLD | NEW |