llvm.org GIT mirror llvm / 8157206
UpdateTestChecks: sparc march handling Summary: Another target that prefers to use `-march` in tests ``` llvm/test/CodeGen/SPARC$ grep -ri mtriple | wc -l 25 llvm/test/CodeGen/SPARC$ grep -ri march | wc -l 165 ``` This test is being affected by a further patch, so regenerate it to better visualize the changes Reviewers: RKSimon, dcederman, gberry Reviewed By: RKSimon Subscribers: jyknight, fedor.sergeev, jrtc27, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62242 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361381 91177308-0d34-0410-b5e6-96231b3b80d8 Roman Lebedev 1 year, 6 months ago
2 changed file(s) with 63 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
0 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
1 ; RUN: llc -march=sparc < %s | FileCheck %s --check-prefix=V8
12 ; RUN: llc -march=sparcv9 < %s | FileCheck %s --check-prefix=SPARC64
23
3 ; V8-LABEL: variable_alloca_with_adj_call_stack
4 ; V8: save %sp, -96, %sp
54 ; (this should ideally be doing "add 4+7; and -8", instead of
65 ; "add 7; and -8; add 8"; see comments in LowerDYNAMIC_STACKALLOC)
7 ; V8: add %i0, 7, %i0
8 ; V8-NEXT: and %i0, -8, %i0
9 ; V8-NEXT: add %i0, 8, %i0
10 ; V8-NEXT: sub %sp, %i0, %i0
11 ; V8-NEXT: add %i0, 96, %o0
12 ; V8: add %sp, -16, %sp
13 ; V8: call foo
14 ; V8: add %sp, 16, %sp
15
16 ; SPARC64-LABEL: variable_alloca_with_adj_call_stack
17 ; SPARC64: save %sp, -128, %sp
18 ; SPARC64: add {{.+}}, 2175, %o0
19 ; SPARC64: add %sp, -80, %sp
20 ; SPARC64: call foo
21 ; SPARC64: add %sp, 80, %sp
226
237 define void @variable_alloca_with_adj_call_stack(i32 %num) {
8 ; V8-LABEL: variable_alloca_with_adj_call_stack:
9 ; V8: .cfi_startproc
10 ; V8-NEXT: ! %bb.0: ! %entry
11 ; V8-NEXT: save %sp, -96, %sp
12 ; V8-NEXT: .cfi_def_cfa_register %fp
13 ; V8-NEXT: .cfi_window_save
14 ; V8-NEXT: .cfi_register 15, 31
15 ; V8-NEXT: add %i0, 7, %i0
16 ; V8-NEXT: and %i0, -8, %i0
17 ; V8-NEXT: add %i0, 8, %i0
18 ; V8-NEXT: sub %sp, %i0, %i0
19 ; V8-NEXT: add %i0, 96, %o0
20 ; V8-NEXT: mov %i0, %sp
21 ; V8-NEXT: add %sp, -16, %sp
22 ; V8-NEXT: st %o0, [%sp+104]
23 ; V8-NEXT: st %o0, [%sp+100]
24 ; V8-NEXT: st %o0, [%sp+96]
25 ; V8-NEXT: st %o0, [%sp+92]
26 ; V8-NEXT: mov %o0, %o1
27 ; V8-NEXT: mov %o0, %o2
28 ; V8-NEXT: mov %o0, %o3
29 ; V8-NEXT: mov %o0, %o4
30 ; V8-NEXT: call foo
31 ; V8-NEXT: mov %o0, %o5
32 ; V8-NEXT: add %sp, 16, %sp
33 ; V8-NEXT: ret
34 ; V8-NEXT: restore
35 ;
36 ; SPARC64-LABEL: variable_alloca_with_adj_call_stack:
37 ; SPARC64: .cfi_startproc
38 ; SPARC64-NEXT: ! %bb.0: ! %entry
39 ; SPARC64-NEXT: save %sp, -128, %sp
40 ; SPARC64-NEXT: .cfi_def_cfa_register %fp
41 ; SPARC64-NEXT: .cfi_window_save
42 ; SPARC64-NEXT: .cfi_register 15, 31
43 ; SPARC64-NEXT: srl %i0, 0, %i0
44 ; SPARC64-NEXT: add %i0, 15, %i0
45 ; SPARC64-NEXT: sethi 4194303, %i1
46 ; SPARC64-NEXT: or %i1, 1008, %i1
47 ; SPARC64-NEXT: sethi 0, %i2
48 ; SPARC64-NEXT: or %i2, 1, %i2
49 ; SPARC64-NEXT: sllx %i2, 32, %i2
50 ; SPARC64-NEXT: or %i2, %i1, %i1
51 ; SPARC64-NEXT: and %i0, %i1, %i0
52 ; SPARC64-NEXT: sub %sp, %i0, %i0
53 ; SPARC64-NEXT: add %i0, 2175, %o0
54 ; SPARC64-NEXT: mov %i0, %sp
55 ; SPARC64-NEXT: add %sp, -80, %sp
56 ; SPARC64-NEXT: stx %o0, [%sp+2247]
57 ; SPARC64-NEXT: stx %o0, [%sp+2239]
58 ; SPARC64-NEXT: stx %o0, [%sp+2231]
59 ; SPARC64-NEXT: stx %o0, [%sp+2223]
60 ; SPARC64-NEXT: mov %o0, %o1
61 ; SPARC64-NEXT: mov %o0, %o2
62 ; SPARC64-NEXT: mov %o0, %o3
63 ; SPARC64-NEXT: mov %o0, %o4
64 ; SPARC64-NEXT: call foo
65 ; SPARC64-NEXT: mov %o0, %o5
66 ; SPARC64-NEXT: add %sp, 80, %sp
67 ; SPARC64-NEXT: ret
68 ; SPARC64-NEXT: restore
2469 entry:
2570 %0 = alloca i8, i32 %num, align 8
2671 call void @foo(i8* %0, i8* %0, i8* %0, i8* %0, i8* %0, i8* %0, i8* %0, i8* %0, i8* %0, i8* %0)
218218 def get_triple_from_march(march):
219219 triples = {
220220 'amdgcn': 'amdgcn',
221 'sparc': 'sparc',
221222 }
222223 for prefix, triple in triples.items():
223224 if march.startswith(prefix):