File: 2013-05-17-CallFrame.ll

package info (click to toggle)
llvm-toolchain-6.0 1%3A6.0.1-10
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 598,080 kB
  • sloc: cpp: 3,046,253; ansic: 595,057; asm: 271,965; python: 128,926; objc: 106,554; sh: 21,906; lisp: 10,191; pascal: 6,094; ml: 5,544; perl: 5,265; makefile: 2,227; cs: 2,027; xml: 686; php: 212; csh: 117
file content (31 lines) | stat: -rw-r--r-- 1,077 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
; RUN: llc -march=sparc   < %s | FileCheck %s --check-prefix=V8
; RUN: llc -march=sparcv9 < %s | FileCheck %s --check-prefix=SPARC64

; V8-LABEL: variable_alloca_with_adj_call_stack
; V8:       save %sp, -96, %sp
; (this should ideally be doing "add 4+7; and -8", instead of
;  "add 7; and -8; add 8"; see comments in LowerDYNAMIC_STACKALLOC)
; V8:       add %i0, 7, %i0
; V8-NEXT:  and %i0, -8, %i0
; V8-NEXT:  add %i0, 8, %i0
; V8-NEXT:  sub %sp, %i0, %i0
; V8-NEXT:  add %i0, 96, %o0
; V8:       add %sp, -16, %sp
; V8:       call foo
; V8:       add %sp, 16, %sp

; SPARC64-LABEL: variable_alloca_with_adj_call_stack
; SPARC64:       save %sp, -128, %sp
; SPARC64:       add {{.+}}, 2175, %o0
; SPARC64:       add %sp, -80, %sp
; SPARC64:       call foo
; SPARC64:       add %sp, 80, %sp

define void @variable_alloca_with_adj_call_stack(i32 %num) {
entry:
  %0 = alloca i8, i32 %num, align 8
  call void @foo(i8* %0, i8* %0, i8* %0, i8* %0, i8* %0, i8* %0, i8* %0, i8* %0, i8* %0, i8* %0)
  ret void
}

declare void @foo(i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*);