Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/ConstantMerge/dont-merge.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

117 lines
2.8 KiB
LLVM

; RUN: opt < %s -passes=constmerge -S | FileCheck %s
; Don't merge constants with specified sections.
@T1G1 = internal constant i32 1, section "foo"
@T1G2 = internal constant i32 1, section "bar"
@T1G3 = internal constant i32 1, section "bar"
; CHECK: @T1G1
; CHECK: @T1G2
; CHECK: @T1G3
define void @test1(ptr %P1, ptr %P2, ptr %P3) {
store ptr @T1G1, ptr %P1
store ptr @T1G2, ptr %P2
store ptr @T1G3, ptr %P3
ret void
}
@T2a = internal constant i32 224
@T2b = internal addrspace(30) constant i32 224
; CHECK: @T2a
; CHECK: @T2b
define void @test2(ptr %P1, ptr %P2) {
store ptr @T2a, ptr %P1
store ptr addrspace(30) @T2b, ptr %P2
ret void
}
; PR8144 - Don't merge globals marked attribute(used)
; CHECK: @T3A =
; CHECK: @T3B =
@T3A = internal constant i32 0
@T3B = internal constant i32 0
@llvm.used = appending global [2 x ptr] [ptr @T3A, ptr @T3B], section
"llvm.metadata"
define void @test3() {
call void asm sideeffect "T3A, T3B",""() ; invisible use of T3A and T3B
ret void
}
; Don't merge constants with !type annotations.
@T4A1 = internal constant i32 2, !type !0
@T4A2 = internal unnamed_addr constant i32 2, !type !1
@T4B1 = internal constant i32 3, !type !0
@T4B2 = internal unnamed_addr constant i32 3, !type !0
@T4C1 = internal constant i32 4, !type !0
@T4C2 = unnamed_addr constant i32 4
@T4D1 = unnamed_addr constant i32 5, !type !0
@T4D2 = internal constant i32 5
!0 = !{i64 0, !"typeinfo name for A"}
!1 = !{i64 0, !"typeinfo name for B"}
; CHECK: @T4A1
; CHECK: @T4A2
; CHECK: @T4B1
; CHECK: @T4B2
; CHECK: @T4C1
; CHECK: @T4C2
; CHECK: @T4D1
; CHECK: @T4D2
define void @test4(ptr %P1, ptr %P2, ptr %P3, ptr %P4, ptr %P5, ptr %P6, ptr %P7, ptr %P8) {
store ptr @T4A1, ptr %P1
store ptr @T4A2, ptr %P2
store ptr @T4B1, ptr %P3
store ptr @T4B2, ptr %P4
store ptr @T4C1, ptr %P5
store ptr @T4C2, ptr %P6
store ptr @T4D1, ptr %P7
store ptr @T4D2, ptr %P8
ret void
}
; CHECK: @T5tls
; CHECK: @T5ua
@T5tls = private thread_local constant i32 555
@T5ua = private unnamed_addr constant i32 555
define void @test5(ptr %P1, ptr %P2) {
store ptr @T5tls, ptr %P1
store ptr @T5ua, ptr %P2
ret void
}
$test6a = comdat any
$test6b = comdat any
; If @T6a were to get merged into @T6b and the $test6b comdat group gets dropped,
; @test6a would have a (now invalid) reference to the dropped @T6b constant
@T6a = private unnamed_addr constant i32 666, comdat($test6a)
@T6b = private unnamed_addr constant i32 666, comdat($test6b)
; CHECK: @T6a
; CHECK: @T6b
define void @test6a(ptr %P) comdat {
store ptr @T6a, ptr %P
ret void
}
define void @test6b(ptr %P) comdat {
store ptr @T6b, ptr %P
ret void
}