Files
TheRock/compiler/amd-llvm/llvm/test/tools/llvm-split/preserve-locals.ll
T
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

67 lines
1.8 KiB
LLVM

; RUN: llvm-split -preserve-locals -o %t %s
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK0 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK1 %s
; The main and a must not be separated.
; The main and local_func must not be together.
; CHECK0: @a
; CHECK0: define i32 @main
; CHECK0: declare dso_local fastcc void @local_func
; The local_var and local_func must not be separated.
; CHECK1: @local_var
; CHECK1: define internal fastcc void @local_func
@a = internal global i32 0, align 4
@global_storage = common global i32 0, align 4
@local_var = internal global i32 0, align 4
; Function Attrs: nounwind
define i32 @main(i32 %x) {
entry:
%call = call fastcc i32 @foo(i32 %x, ptr nonnull @a)
%call1 = call fastcc i32 @baz(i32 %x)
%add = add nsw i32 %call, %call1
ret i32 %add
}
; Function Attrs: nounwind
define fastcc i32 @bar(i32 %b) {
entry:
%call = call fastcc i32 @baz(i32 %b)
ret i32 %call
}
; Function Attrs: nounwind
define fastcc i32 @baz(i32 %x) {
entry:
store i32 %x, ptr @global_storage, align 4
%shl = shl i32 %x, %x
ret i32 %shl
}
; Function Attrs: noinline nounwind
define fastcc i32 @foo(i32 %a, ptr nocapture %b) {
entry:
call fastcc void @local_func()
%call = call fastcc i32 @bar(i32 %a)
%0 = load i32, ptr @global_storage, align 4
%call1 = call fastcc i32 @baz(i32 %0)
%add = add nsw i32 %call, %call1
store i32 %add, ptr %b, align 4
%call.i = call fastcc i32 @baz(i32 %add) #2
%add.i = add nsw i32 %call.i, 2
%1 = load volatile i32, ptr @local_var, align 4
%add3 = add nsw i32 %add.i, %1
ret i32 %add3
}
; Function Attrs: noinline nounwind
define internal fastcc void @local_func() section ".text" {
entry:
%0 = load i32, ptr @global_storage, align 4
%call = call fastcc i32 @foo(i32 %0, ptr null)
store volatile i32 %call, ptr @local_var, align 4
ret void
}