File: fastcc_byval.ll

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2~deb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 995,836 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (27 lines) | stat: -rw-r--r-- 1,231 bytes parent folder | download | duplicates (7)
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
; RUN: llc -mtriple=mipsel-linux-gnu -O3 -relocation-model=pic < %s | FileCheck %s

; Test that a load comes after a store to the same memory location when passing
; a byVal parameter to a function which has a fastcc function call

%struct.str = type { i32, i32, [3 x i32*] }

declare fastcc void @_Z1F3str(%struct.str* noalias nocapture sret %agg.result, %struct.str* byval nocapture readonly align 4 %s)

define i32 @_Z1g3str(%struct.str* byval nocapture readonly align 4 %s) {
; CHECK-LABEL: _Z1g3str:
; CHECK: sw  $7, [[OFFSET:[0-9]+]]($sp)
; CHECK: lw  ${{[0-9]+}}, [[OFFSET]]($sp)
entry:
  %ref.tmp = alloca %struct.str, align 4
  %0 = bitcast %struct.str* %ref.tmp to i8*
  call void @llvm.lifetime.start.p0i8(i64 20, i8* nonnull %0)
  call fastcc void @_Z1F3str(%struct.str* nonnull sret %ref.tmp, %struct.str* byval nonnull align 4 %s)
  %cl.sroa.3.0..sroa_idx2 = getelementptr inbounds %struct.str, %struct.str* %ref.tmp, i32 0, i32 1
  %cl.sroa.3.0.copyload = load i32, i32* %cl.sroa.3.0..sroa_idx2, align 4
  call void @llvm.lifetime.end.p0i8(i64 20, i8* nonnull %0)
  ret i32 %cl.sroa.3.0.copyload
}

declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture)

declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture)