Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: tests_lit/llvm2ice_tests/ebp_args.ll

Issue 444443002: Subzero: Align the stack at the point of function calls. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Comments round 3 Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests_lit/llvm2ice_tests/alloc.ll ('k') | tests_lit/llvm2ice_tests/fp.pnacl.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 ; This test originally exhibited a bug in ebp-based stack slots. The 1 ; This test originally exhibited a bug in ebp-based stack slots. The
2 ; problem was that during a function call push sequence, the esp 2 ; problem was that during a function call push sequence, the esp
3 ; adjustment was incorrectly added to the stack/frame offset for 3 ; adjustment was incorrectly added to the stack/frame offset for
4 ; ebp-based frames. 4 ; ebp-based frames.
5 5
6 ; RUN: %llvm2ice -Om1 --target=x8632 --verbose none %s | FileCheck %s 6 ; RUN: %llvm2ice -Om1 --target=x8632 --verbose none %s | FileCheck %s
7 7
8 declare i32 @memcpy_helper2(i32 %buf, i32 %buf2, i32 %n); 8 declare i32 @memcpy_helper2(i32 %buf, i32 %buf2, i32 %n);
9 9
10 define i32 @memcpy_helper(i32 %buf, i32 %n) { 10 define i32 @memcpy_helper(i32 %buf, i32 %n) {
11 entry: 11 entry:
12 %n.arg_trunc = trunc i32 %n to i8 12 %n.arg_trunc = trunc i32 %n to i8
13 %buf2 = alloca i8, i32 128, align 4 13 %buf2 = alloca i8, i32 128, align 4
14 %buf2.asint = ptrtoint i8* %buf2 to i32 14 %buf2.asint = ptrtoint i8* %buf2 to i32
15 %arg_ext = zext i8 %n.arg_trunc to i32 15 %arg_ext = zext i8 %n.arg_trunc to i32
16 %call = call i32 @memcpy_helper2(i32 %buf, i32 %buf2.asint, i32 %arg_ext) 16 %call = call i32 @memcpy_helper2(i32 %buf, i32 %buf2.asint, i32 %arg_ext)
17 ret i32 %call 17 ret i32 %call
18 } 18 }
19 19
20 ; This check sequence is highly specific to the current Om1 lowering 20 ; This check sequence is highly specific to the current Om1 lowering
21 ; and stack slot assignment code, and may need to be relaxed if the 21 ; and stack slot assignment code, and may need to be relaxed if the
22 ; lowering code changes. 22 ; lowering code changes.
23 23
24 ; CHECK: memcpy_helper: 24 ; CHECK: memcpy_helper:
25 ; CHECK: push ebp 25 ; CHECK: push ebx
26 ; CHECK: mov ebp, esp 26 ; CHECK: push ebp
27 ; CHECK: sub esp, 20 27 ; CHECK: mov ebp, esp
28 ; CHECK: mov eax, dword ptr [ebp+12] 28 ; CHECK: sub esp, 20
29 ; CHECK: mov dword ptr [ebp-4], eax 29 ; CHECK: mov eax, dword ptr [ebp+16]
30 ; CHECK: sub esp, 128 30 ; CHECK: mov dword ptr [ebp-4], eax
31 ; CHECK: mov dword ptr [ebp-8], esp 31 ; CHECK: sub esp, 128
32 ; CHECK: mov eax, dword ptr [ebp-8] 32 ; CHECK: mov dword ptr [ebp-8], esp
33 ; CHECK: mov dword ptr [ebp-12], eax 33 ; CHECK: mov eax, dword ptr [ebp-8]
34 ; CHECK: movzx eax, byte ptr [ebp-4] 34 ; CHECK: mov dword ptr [ebp-12], eax
35 ; CHECK: mov dword ptr [ebp-16], eax 35 ; CHECK: movzx eax, byte ptr [ebp-4]
36 ; CHECK: push dword ptr [ebp-16] 36 ; CHECK: mov dword ptr [ebp-16], eax
37 ; CHECK: push dword ptr [ebp-12] 37 ; CHECK: sub esp, 16
38 ; CHECK: push dword ptr [ebp+8] 38 ; CHECK: mov ecx, dword ptr [ebp+12]
39 ; CHECK: call memcpy_helper2 39 ; CHECK: mov dword ptr [esp], ecx
40 ; CHECK: mov edx, dword ptr [ebp-12]
41 ; CHECK: mov dword ptr [esp+4], edx
42 ; CHECK: mov ebx, dword ptr [ebp-16]
43 ; CHECK: mov dword ptr [esp+8], ebx
44 ; CHECK: call memcpy_helper2
OLDNEW
« no previous file with comments | « tests_lit/llvm2ice_tests/alloc.ll ('k') | tests_lit/llvm2ice_tests/fp.pnacl.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698