File: byval.ll

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-6~deb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,418,812 kB
  • sloc: cpp: 5,290,827; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,900; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,892; xml: 953; cs: 573; fortran: 539
file content (35 lines) | stat: -rw-r--r-- 1,064 bytes parent folder | download | duplicates (3)
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
32
33
34
35
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -verify-machineinstrs < %s | FileCheck %s

target datalayout = "e-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512"
target triple = "powerpc64le-unknown-linux-gnu"

%struct = type { [4 x i32], [20 x i8] }

declare dso_local i32 @foo1(%struct* byval(%struct) %var)
declare dso_local void @foo(%struct* %var)

; FIXME: for the byval parameter %x, now the memory for local variable and
; for parameter save area are overlap.
; For the below case,
; the local variable space is r1 + 40 ~ r1 + 76
; the parameter save area is r1 + 32 ~ r1 + 68

define dso_local i32 @bar() {
; CHECK-LABEL: bar:
; CHECK:    addi 30, 1, 40
; CHECK:    li 3, 16
; CHECK:    lxvd2x 0, 30, 3
; CHECK:    li 3, 48
; CHECK:    stxvd2x 0, 1, 3
; CHECK:    li 3, 32
; CHECK:    lxvd2x 0, 0, 30
; CHECK:    stxvd2x 0, 1, 3
; CHECK:    lwz 3, 72(1)
; CHECK:    stw 3, 64(1)
entry:
  %x = alloca %struct, align 4
  call void @foo(%struct* %x)
  %r = call i32 @foo1(%struct* byval(%struct) %x)
  ret i32 %r
}