File: arm-call-lowering.ll

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 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 (75 lines) | stat: -rw-r--r-- 4,201 bytes parent folder | download | duplicates (2)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
; RUN: llc -mtriple arm-unknown -mattr=-v4t -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=CHECK,NOV4T,ARM
; RUN: llc -mtriple arm-unknown -mattr=+v4t -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=CHECK,V4T,ARM
; RUN: llc -mtriple arm-unknown -mattr=+v5t -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=CHECK,V5T,ARM
; RUN: llc -mtriple thumb-unknown -mattr=+v6t2 -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=CHECK,THUMB

define arm_aapcscc void @test_indirect_call(void() *%fptr) {
  ; NOV4T-LABEL: name: test_indirect_call
  ; NOV4T: bb.1.entry:
  ; NOV4T:   liveins: $r0
  ; NOV4T:   [[COPY:%[0-9]+]]:tgpr(p0) = COPY $r0
  ; NOV4T:   ADJCALLSTACKDOWN 0, 0, 14 /* CC::al */, $noreg, implicit-def $sp, implicit $sp
  ; NOV4T:   BMOVPCRX_CALL [[COPY]](p0), csr_aapcs, implicit-def $lr, implicit $sp
  ; NOV4T:   ADJCALLSTACKUP 0, 0, 14 /* CC::al */, $noreg, implicit-def $sp, implicit $sp
  ; NOV4T:   MOVPCLR 14 /* CC::al */, $noreg
  ; V4T-LABEL: name: test_indirect_call
  ; V4T: bb.1.entry:
  ; V4T:   liveins: $r0
  ; V4T:   [[COPY:%[0-9]+]]:tgpr(p0) = COPY $r0
  ; V4T:   ADJCALLSTACKDOWN 0, 0, 14 /* CC::al */, $noreg, implicit-def $sp, implicit $sp
  ; V4T:   BX_CALL [[COPY]](p0), csr_aapcs, implicit-def $lr, implicit $sp
  ; V4T:   ADJCALLSTACKUP 0, 0, 14 /* CC::al */, $noreg, implicit-def $sp, implicit $sp
  ; V4T:   BX_RET 14 /* CC::al */, $noreg
  ; V5T-LABEL: name: test_indirect_call
  ; V5T: bb.1.entry:
  ; V5T:   liveins: $r0
  ; V5T:   [[COPY:%[0-9]+]]:gpr(p0) = COPY $r0
  ; V5T:   ADJCALLSTACKDOWN 0, 0, 14 /* CC::al */, $noreg, implicit-def $sp, implicit $sp
  ; V5T:   BLX [[COPY]](p0), csr_aapcs, implicit-def $lr, implicit $sp
  ; V5T:   ADJCALLSTACKUP 0, 0, 14 /* CC::al */, $noreg, implicit-def $sp, implicit $sp
  ; V5T:   BX_RET 14 /* CC::al */, $noreg
  ; THUMB-LABEL: name: test_indirect_call
  ; THUMB: bb.1.entry:
  ; THUMB:   liveins: $r0
  ; THUMB:   [[COPY:%[0-9]+]]:gpr(p0) = COPY $r0
  ; THUMB:   ADJCALLSTACKDOWN 0, 0, 14 /* CC::al */, $noreg, implicit-def $sp, implicit $sp
  ; THUMB:   tBLXr 14 /* CC::al */, $noreg, [[COPY]](p0), csr_aapcs, implicit-def $lr, implicit $sp
  ; THUMB:   ADJCALLSTACKUP 0, 0, 14 /* CC::al */, $noreg, implicit-def $sp, implicit $sp
  ; THUMB:   tBX_RET 14 /* CC::al */, $noreg
entry:
  notail call arm_aapcscc void %fptr()
  ret void
}

declare arm_aapcscc void @call_target()

define arm_aapcscc void @test_direct_call() {
  ; NOV4T-LABEL: name: test_direct_call
  ; NOV4T: bb.1.entry:
  ; NOV4T:   ADJCALLSTACKDOWN 0, 0, 14 /* CC::al */, $noreg, implicit-def $sp, implicit $sp
  ; NOV4T:   BL @call_target, csr_aapcs, implicit-def $lr, implicit $sp
  ; NOV4T:   ADJCALLSTACKUP 0, 0, 14 /* CC::al */, $noreg, implicit-def $sp, implicit $sp
  ; NOV4T:   MOVPCLR 14 /* CC::al */, $noreg
  ; V4T-LABEL: name: test_direct_call
  ; V4T: bb.1.entry:
  ; V4T:   ADJCALLSTACKDOWN 0, 0, 14 /* CC::al */, $noreg, implicit-def $sp, implicit $sp
  ; V4T:   BL @call_target, csr_aapcs, implicit-def $lr, implicit $sp
  ; V4T:   ADJCALLSTACKUP 0, 0, 14 /* CC::al */, $noreg, implicit-def $sp, implicit $sp
  ; V4T:   BX_RET 14 /* CC::al */, $noreg
  ; V5T-LABEL: name: test_direct_call
  ; V5T: bb.1.entry:
  ; V5T:   ADJCALLSTACKDOWN 0, 0, 14 /* CC::al */, $noreg, implicit-def $sp, implicit $sp
  ; V5T:   BL @call_target, csr_aapcs, implicit-def $lr, implicit $sp
  ; V5T:   ADJCALLSTACKUP 0, 0, 14 /* CC::al */, $noreg, implicit-def $sp, implicit $sp
  ; V5T:   BX_RET 14 /* CC::al */, $noreg
  ; THUMB-LABEL: name: test_direct_call
  ; THUMB: bb.1.entry:
  ; THUMB:   ADJCALLSTACKDOWN 0, 0, 14 /* CC::al */, $noreg, implicit-def $sp, implicit $sp
  ; THUMB:   tBL 14 /* CC::al */, $noreg, @call_target, csr_aapcs, implicit-def $lr, implicit $sp
  ; THUMB:   ADJCALLSTACKUP 0, 0, 14 /* CC::al */, $noreg, implicit-def $sp, implicit $sp
  ; THUMB:   tBX_RET 14 /* CC::al */, $noreg
entry:
  notail call arm_aapcscc void @call_target()
  ret void
}