File: win-import-call-optimization.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 (48 lines) | stat: -rw-r--r-- 1,818 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
; RUN: llc -mtriple=aarch64-pc-windows-msvc -aarch64-win-import-call-optimization < %s | FileCheck %s --check-prefix=CHECK-ENABLED
; RUN: llc -mtriple=aarch64-pc-windows-msvc < %s | FileCheck %s --check-prefix=CHECK-DISABLED

; CHECK-DISABLED-NOT: .section        .impcall

define dso_local void @normal_call() local_unnamed_addr section "nc_sect" {
entry:
  call void @a()
  call void @a()
  ret void
}
; CHECK-ENABLED-LABEL:  normal_call:
; CHECK-ENABLED:        adrp    [[ADRPREG:x[0-9]+]], __imp_a
; CHECK-ENABLED-NEXT:   ldr     [[LDRREG:x[0-9]+]], [[[ADRPREG]], :lo12:__imp_a]
; CHECK-ENABLED-NEXT:   .Limpcall0:
; CHECK-ENABLED-NEXT:   blr     [[LDRREG]]
; CHECK-ENABLED-NEXT:   .Limpcall1:
; CHECK-ENABLED-NEXT:   blr     [[LDRREG]]

define dso_local void @tail_call() local_unnamed_addr section "tc_sect" {
entry:
  tail call void @b()
  ret void
}
; CHECK-ENABLED-LABEL:  tail_call:
; CHECK-ENABLED:        adrp    [[ADRPREG:x[0-9]+]], __imp_b
; CHECK-ENABLED-NEXT:   ldr     [[LDRREG:x[0-9]+]], [[[ADRPREG]], :lo12:__imp_b]
; CHECK-ENABLED-NEXT:   .Limpcall2:
; CHECK-ENABLED-NEXT:   br      [[LDRREG]]

declare dllimport void @a() local_unnamed_addr
declare dllimport void @b() local_unnamed_addr

; CHECK-ENABLED-LABEL  .section   .impcall,"yi"
; CHECK-ENABLED-NEXT   .asciz  "Imp_Call_V1"
; CHECK-ENABLED-NEXT   .word   32
; CHECK-ENABLED-NEXT   .secnum nc_sect
; CHECK-ENABLED-NEXT   .word   19
; CHECK-ENABLED-NEXT   .secoffset      .Limpcall0
; CHECK-ENABLED-NEXT   .symidx __imp_a
; CHECK-ENABLED-NEXT   .word   19
; CHECK-ENABLED-NEXT   .secoffset      .Limpcall1
; CHECK-ENABLED-NEXT   .symidx __imp_a
; CHECK-ENABLED-NEXT   .word   20
; CHECK-ENABLED-NEXT   .secnum tc_sect
; CHECK-ENABLED-NEXT   .word   19
; CHECK-ENABLED-NEXT   .secoffset      .Limpcall2
; CHECK-ENABLED-NEXT   .symidx __imp_b