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

62 lines
2.7 KiB
LLVM

; RUN: opt -S -mtriple=amdgcn-- -amdgpu-lower-module-lds < %s | FileCheck %s
; RUN: opt -S -mtriple=amdgcn-- -passes=amdgpu-lower-module-lds < %s | FileCheck %s
; Variables that are not lowered by this pass are left unchanged
; CHECK-NOT: asm
; CHECK-NOT: llvm.amdgcn.module.lds
; CHECK-NOT: llvm.amdgcn.module.lds.t
; var1 is removed, var2 stays because it's in compiler.used
; CHECK-NOT: @var1
; CHECK: @var2 = addrspace(3) global float poison
@var1 = addrspace(3) global i32 poison
@var2 = addrspace(3) global float poison
; constant variables are left to the optimizer / error diagnostics
; CHECK: @const_undef = addrspace(3) constant i32 undef
; CHECK: @const_with_init = addrspace(3) constant i64 8
@const_undef = addrspace(3) constant i32 undef
@const_with_init = addrspace(3) constant i64 8
; Use of an addrspace(3) variable with an initializer is skipped,
; so as to preserve the unimplemented error from llc
; CHECK: @with_init = addrspace(3) global i64 0
@with_init = addrspace(3) global i64 0
; Only local addrspace variables are transformed
; CHECK: @addr4 = addrspace(4) global i64 poison
@addr4 = addrspace(4) global i64 poison
; Assign to self is treated as any other initializer, i.e. ignored by this pass
; CHECK: @toself = addrspace(3) global ptr addrspace(3) @toself, align 8
@toself = addrspace(3) global ptr addrspace(3) @toself, align 8
; Use by .used lists doesn't trigger lowering
; CHECK-NOT: @llvm.used =
@llvm.used = appending global [1 x ptr] [ptr addrspacecast (ptr addrspace(3) @var1 to ptr)], section "llvm.metadata"
; CHECK: @llvm.compiler.used = appending global [1 x ptr] [ptr addrspacecast (ptr addrspace(3) @var2 to ptr)], section "llvm.metadata"
@llvm.compiler.used = appending global [1 x ptr] [ptr addrspacecast (ptr addrspace(3) @var2 to ptr)], section "llvm.metadata"
; Access from a function would cause lowering for non-excluded cases
; CHECK-LABEL: @use_variables()
; CHECK: %c0 = load i32, ptr addrspace(3) @const_undef, align 4
; CHECK: %c1 = load i64, ptr addrspace(3) @const_with_init, align 4
; CHECK: %v0 = atomicrmw add ptr addrspace(3) @with_init, i64 1 seq_cst
; CHECK: %v1 = atomicrmw add ptr addrspace(4) @addr4, i64 %c1 monotonic
define void @use_variables() {
%c0 = load i32, ptr addrspace(3) @const_undef, align 4
%c1 = load i64, ptr addrspace(3) @const_with_init, align 4
%v0 = atomicrmw add ptr addrspace(3) @with_init, i64 1 seq_cst
%v1 = atomicrmw add ptr addrspace(4) @addr4, i64 %c1 monotonic
ret void
}
; CHECK-LABEL: @kern_use()
; CHECK: %inc = atomicrmw add ptr addrspace(3) @llvm.amdgcn.kernel.kern_use.lds, i32 1 monotonic, align 4
define amdgpu_kernel void @kern_use() {
%inc = atomicrmw add ptr addrspace(3) @var1, i32 1 monotonic
call void @use_variables()
ret void
}