File: call-16bit.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (64 lines) | stat: -rw-r--r-- 1,937 bytes parent folder | download | duplicates (9)
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
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -verify-machineinstrs -csky-no-aliases < %s -mtriple=csky  | FileCheck %s

@p_fun = global ptr @bar, align 8

declare void @bar(i32, i32)

define void @foo(i32 %a, ptr %ptr){
; CHECK-LABEL: foo:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    subi16 sp, sp, 4
; CHECK-NEXT:    .cfi_def_cfa_offset 4
; CHECK-NEXT:    st32.w lr, (sp, 0) # 4-byte Folded Spill
; CHECK-NEXT:    .cfi_offset lr, -4
; CHECK-NEXT:    subi16 sp, sp, 4
; CHECK-NEXT:    .cfi_def_cfa_offset 8
; CHECK-NEXT:    ld16.w a1, (a1, 0)
; CHECK-NEXT:    lrw32 a2, [.LCPI0_0]
; CHECK-NEXT:    jsr16 a2
; CHECK-NEXT:    addi16 sp, sp, 4
; CHECK-NEXT:    ld32.w lr, (sp, 0) # 4-byte Folded Reload
; CHECK-NEXT:    addi16 sp, sp, 4
; CHECK-NEXT:    rts16
; CHECK-NEXT:    .p2align 1
; CHECK-NEXT:  # %bb.1:
; CHECK-NEXT:    .p2align 2
; CHECK-NEXT:  .LCPI0_0:
; CHECK-NEXT:    .long bar
;
entry:
  %0 = load i32, ptr %ptr
  tail call void (i32, i32) @bar(i32 %a, i32 %0)
  ret void
}

define void @foo_indirect(i32 %a, ptr %ptr) {
; CHECK-LABEL: foo_indirect:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    subi16 sp, sp, 4
; CHECK-NEXT:    .cfi_def_cfa_offset 4
; CHECK-NEXT:    st32.w lr, (sp, 0) # 4-byte Folded Spill
; CHECK-NEXT:    .cfi_offset lr, -4
; CHECK-NEXT:    subi16 sp, sp, 4
; CHECK-NEXT:    .cfi_def_cfa_offset 8
; CHECK-NEXT:    lrw32 a2, [.LCPI1_0]
; CHECK-NEXT:    ld16.w a2, (a2, 0)
; CHECK-NEXT:    ld16.w a1, (a1, 0)
; CHECK-NEXT:    jsr16 a2
; CHECK-NEXT:    addi16 sp, sp, 4
; CHECK-NEXT:    ld32.w lr, (sp, 0) # 4-byte Folded Reload
; CHECK-NEXT:    addi16 sp, sp, 4
; CHECK-NEXT:    rts16
; CHECK-NEXT:    .p2align 1
; CHECK-NEXT:  # %bb.1:
; CHECK-NEXT:    .p2align 2
; CHECK-NEXT:  .LCPI1_0:
; CHECK-NEXT:    .long p_fun
;
entry:
  %0 = load ptr, ptr @p_fun, align 8
  %1 = load i32, ptr %ptr
  tail call void (i32, i32) %0(i32 %a, i32 %1)
  ret void
}