OLD | NEW |
1 ; This file checks that SimpleCoalescing of local stack slots is not done | 1 ; This file checks that SimpleCoalescing of local stack slots is not done |
2 ; when calling a function with the "returns twice" attribute. | 2 ; when calling a function with the "returns twice" attribute. |
3 | 3 |
4 ; RUN: %llvm2ice -Om1 --verbose none %s \ | 4 ; RUN: %llvm2ice -Om1 --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 --verbose none %s | FileCheck --check-prefix=ERRORS %s | 7 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s |
8 | 8 |
9 ; Setjmp is a function with the "returns twice" attribute. | 9 ; Setjmp is a function with the "returns twice" attribute. |
10 declare i32 @llvm.nacl.setjmp(i8*) | 10 declare i32 @llvm.nacl.setjmp(i8*) |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 ret i32 %other_local | 48 ret i32 %other_local |
49 NonZero: | 49 NonZero: |
50 ret i32 1 | 50 ret i32 1 |
51 } | 51 } |
52 | 52 |
53 ; CHECK-LABEL: no_call_returns_twice | 53 ; CHECK-LABEL: no_call_returns_twice |
54 ; CHECK: add [[REG1:.*]], 12345 | 54 ; CHECK: add [[REG1:.*]], 12345 |
55 ; CHECK: mov dword ptr [esp + [[OFF:.*]]], [[REG1]] | 55 ; CHECK: mov dword ptr [esp + [[OFF:.*]]], [[REG1]] |
56 ; CHECK: add [[REG2:.*]], 54321 | 56 ; CHECK: add [[REG2:.*]], 54321 |
57 ; Now there should be sharing of the stack slot (OFF is the same). | 57 ; Now there should be sharing of the stack slot (OFF is the same). |
58 ; CHECK: mov dword ptr [esp + [[OFF]]], [[REG2]] | 58 ; Commenting out after disabling simple coalescing for -Om1. |
| 59 ; TODO(stichnot): Add it back if/when we add a flag to enable simple |
| 60 ; coalescing. |
| 61 ; xCHECK: mov dword ptr [esp + [[OFF]]], [[REG2]] |
59 | 62 |
60 ; ERRORS-NOT: ICE translation error | 63 ; ERRORS-NOT: ICE translation error |
OLD | NEW |