Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/SPIRV/passes/SPIRVPrepareGlobals.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

54 lines
1.9 KiB
LLVM

; RUN: opt -S -passes=spirv-prepare-globals -mtriple=spirv64-unknown-unknown < %s | FileCheck %s
; The pass folds non-interposable GlobalAlias instances away from their uses.
; - For private (discardable) aliases, the alias declaration is also erased.
; - For externally-linked aliases, the declaration is preserved but uses are
; replaced.
; Interposable aliases (or aliases of interposable globals) must be left
; untouched, since their target may change at link time.
; CHECK-NOT: @alias_private
; CHECK-DAG: @aliasee = global i32 42
; CHECK-DAG: @alias_external = alias i32, ptr @aliasee
; CHECK-DAG: @weak_alias = weak alias i32, ptr @weak_aliasee
; CHECK-DAG: @alias_of_interposable = alias i32, ptr @interposable_aliasee
@aliasee = global i32 42
@alias_private = private alias i32, ptr @aliasee
@alias_external = alias i32, ptr @aliasee
@weak_aliasee = global i32 7
@weak_alias = weak alias i32, ptr @weak_aliasee
@interposable_aliasee = weak global i32 99
@alias_of_interposable = alias i32, ptr @interposable_aliasee
; Private alias is discardable: use is RAUW'd to the aliasee.
define ptr @use_private_alias() {
; CHECK-LABEL: define ptr @use_private_alias()
; CHECK-NEXT: ret ptr @aliasee
ret ptr @alias_private
}
; External alias: use is RAUW'd to the aliasee, but @alias_external itself
; remains in the module (checked above with CHECK-DAG).
define ptr @use_external_alias() {
; CHECK-LABEL: define ptr @use_external_alias()
; CHECK-NEXT: ret ptr @aliasee
ret ptr @alias_external
}
; Weak (interposable) alias is left alone.
define ptr @use_weak_alias() {
; CHECK-LABEL: define ptr @use_weak_alias()
; CHECK-NEXT: ret ptr @weak_alias
ret ptr @weak_alias
}
; Alias of an interposable global is left alone.
define ptr @use_alias_of_interposable() {
; CHECK-LABEL: define ptr @use_alias_of_interposable()
; CHECK-NEXT: ret ptr @alias_of_interposable
ret ptr @alias_of_interposable
}