Files
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

86 lines
2.6 KiB
LLVM

; RUN: llc -mtriple=aarch64-pc-windows-msvc %s -o - | FileCheck %s
define dso_local void @normal_call() local_unnamed_addr section "nc_sect" {
entry:
call void @a()
call void @a()
ret void
}
; CHECK-LABEL: normal_call:
; CHECK: adrp [[ADRPREG:x[0-9]+]], __imp_a
; CHECK-NEXT: ldr [[LDRREG:x[0-9]+]], [[[ADRPREG]], :lo12:__imp_a]
; CHECK-NEXT: .Limpcall0:
; CHECK-NEXT: blr [[LDRREG]]
; CHECK-NEXT: .Limpcall1:
; CHECK-NEXT: blr [[LDRREG]]
define dso_local void @tail_call() local_unnamed_addr section "tc_sect" {
entry:
tail call void @b()
ret void
}
; CHECK-LABEL: tail_call:
; CHECK: adrp [[ADRPREG:x[0-9]+]], __imp_b
; CHECK-NEXT: ldr [[LDRREG:x[0-9]+]], [[[ADRPREG]], :lo12:__imp_b]
; CHECK-NEXT: .Limpcall2:
; CHECK-NEXT: br [[LDRREG]]
; Regression test: branch folding would notice that both of these calls become
; branch instructions to the same register and would fold them. However, import
; call optimization requires them to remain separate as they are for different
; functions.
define dso_local void @call_one_or_other(i32 %val) local_unnamed_addr {
%is_zero = icmp eq i32 %val, 0
br i1 %is_zero, label %call_a, label %call_b
call_a:
call void @a()
br label %finish
call_b:
call void @b()
br label %finish
finish:
ret void
}
; CHECK-LABEL: call_one_or_other:
; CHECK: adrp [[ADRPREG:x[0-9]+]], __imp_b
; CHECK-NEXT: ldr [[LDRREG:x[0-9]+]], [[[ADRPREG]], :lo12:__imp_b]
; CHECK-NEXT: .Limpcall3:
; CHECK-NEXT: blr [[LDRREG]]
; CHECK: adrp [[ADRPREG:x[0-9]+]], __imp_a
; CHECK-NEXT: ldr [[LDRREG:x[0-9]+]], [[[ADRPREG]], :lo12:__imp_a]
; CHECK-NEXT: .Limpcall4:
; CHECK-NEXT: blr [[LDRREG]]
declare dllimport void @a() local_unnamed_addr
declare dllimport void @b() local_unnamed_addr
; CHECK-LABEL: .section .impcall,"yi"
; CHECK-NEXT: .asciz "Imp_Call_V1"
; CHECK-NEXT: .word 32
; CHECK-NEXT: .secnum nc_sect
; CHECK-NEXT: .word 19
; CHECK-NEXT: .secoffset .Limpcall0
; CHECK-NEXT: .symidx __imp_a
; CHECK-NEXT: .word 19
; CHECK-NEXT: .secoffset .Limpcall1
; CHECK-NEXT: .symidx __imp_a
; CHECK-NEXT: .word 20
; CHECK-NEXT: .secnum tc_sect
; CHECK-NEXT: .word 19
; CHECK-NEXT: .secoffset .Limpcall2
; CHECK-NEXT: .symidx __imp_b
; CHECK-NEXT: .word 32
; CHECK-NEXT: .secnum .text
; CHECK-NEXT: .word 19
; CHECK-NEXT: .secoffset .Limpcall3
; CHECK-NEXT: .symidx __imp_b
; CHECK-NEXT: .word 19
; CHECK-NEXT: .secoffset .Limpcall4
; CHECK-NEXT: .symidx __imp_a
!llvm.module.flags = !{!0}
!0 = !{i32 1, !"import-call-optimization", i32 1}