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

194 lines
7.2 KiB
LLVM

; FIXME: even under non-pic mode, llvm needs to generate pic code since nld
; doesn't work with non-pic code. Thefore, we test pic codes for
; both cases here.
; llc -mtriple ve < %s | FileCheck %s -check-prefix=LOCAL
; RUN: llc -mtriple ve < %s | FileCheck %s -check-prefix=GENDYN
; RUN: llc -mtriple ve -relocation-model=pic < %s | FileCheck %s -check-prefix=GENDYNPIC
@x = external thread_local global i32, align 4
@y = internal thread_local global i32 0, align 4
; Function Attrs: norecurse nounwind readnone
define nonnull ptr @get_global() {
; GENDYN-LABEL: get_global:
; GENDYN: .LBB{{[0-9]+}}_2:
; GENDYN-NEXT: lea %s0, x@tls_gd_lo(-24)
; GENDYN-NEXT: and %s0, %s0, (32)0
; GENDYN-NEXT: sic %s10
; GENDYN-NEXT: lea.sl %s0, x@tls_gd_hi(%s10, %s0)
; GENDYN-NEXT: lea %s12, __tls_get_addr@plt_lo(8)
; GENDYN-NEXT: and %s12, %s12, (32)0
; GENDYN-NEXT: lea.sl %s12, __tls_get_addr@plt_hi(%s10, %s12)
; GENDYN-NEXT: bsic %s10, (, %s12)
; GENDYN-NEXT: or %s11, 0, %s9
;
; GENDYNPIC-LABEL: get_global:
; GENDYNPIC: .LBB{{[0-9]+}}_2:
; GENDYNPIC-NEXT: lea %s15, _GLOBAL_OFFSET_TABLE_@pc_lo(-24)
; GENDYNPIC-NEXT: and %s15, %s15, (32)0
; GENDYNPIC-NEXT: sic %s16
; GENDYNPIC-NEXT: lea.sl %s15, _GLOBAL_OFFSET_TABLE_@pc_hi(%s16, %s15)
; GENDYNPIC-NEXT: lea %s0, x@tls_gd_lo(-24)
; GENDYNPIC-NEXT: and %s0, %s0, (32)0
; GENDYNPIC-NEXT: sic %s10
; GENDYNPIC-NEXT: lea.sl %s0, x@tls_gd_hi(%s10, %s0)
; GENDYNPIC-NEXT: lea %s12, __tls_get_addr@plt_lo(8)
; GENDYNPIC-NEXT: and %s12, %s12, (32)0
; GENDYNPIC-NEXT: lea.sl %s12, __tls_get_addr@plt_hi(%s10, %s12)
; GENDYNPIC-NEXT: bsic %s10, (, %s12)
; GENDYNPIC-NEXT: or %s11, 0, %s9
;
; LOCAL-LABEL: get_global:
; LOCAL: .LBB{{[0-9]+}}_2:
; LOCAL-NEXT: lea %s34, x@tpoff_lo
; LOCAL-NEXT: and %s34, %s34, (32)0
; LOCAL-NEXT: lea.sl %s34, x@tpoff_hi(%s34)
; LOCAL-NEXT: adds.l %s0, %s14, %s34
; LOCAL-NEXT: or %s11, 0, %s9
entry:
ret ptr @x
}
; Function Attrs: norecurse nounwind readnone
define nonnull ptr @get_local() {
; GENDYN-LABEL: get_local:
; GENDYN: .LBB{{[0-9]+}}_2:
; GENDYN-NEXT: lea %s0, y@tls_gd_lo(-24)
; GENDYN-NEXT: and %s0, %s0, (32)0
; GENDYN-NEXT: sic %s10
; GENDYN-NEXT: lea.sl %s0, y@tls_gd_hi(%s10, %s0)
; GENDYN-NEXT: lea %s12, __tls_get_addr@plt_lo(8)
; GENDYN-NEXT: and %s12, %s12, (32)0
; GENDYN-NEXT: lea.sl %s12, __tls_get_addr@plt_hi(%s10, %s12)
; GENDYN-NEXT: bsic %s10, (, %s12)
; GENDYN-NEXT: or %s11, 0, %s9
;
; GENDYNPIC-LABEL: get_local:
; GENDYNPIC: .LBB{{[0-9]+}}_2:
; GENDYNPIC-NEXT: lea %s15, _GLOBAL_OFFSET_TABLE_@pc_lo(-24)
; GENDYNPIC-NEXT: and %s15, %s15, (32)0
; GENDYNPIC-NEXT: sic %s16
; GENDYNPIC-NEXT: lea.sl %s15, _GLOBAL_OFFSET_TABLE_@pc_hi(%s16, %s15)
; GENDYNPIC-NEXT: lea %s0, y@tls_gd_lo(-24)
; GENDYNPIC-NEXT: and %s0, %s0, (32)0
; GENDYNPIC-NEXT: sic %s10
; GENDYNPIC-NEXT: lea.sl %s0, y@tls_gd_hi(%s10, %s0)
; GENDYNPIC-NEXT: lea %s12, __tls_get_addr@plt_lo(8)
; GENDYNPIC-NEXT: and %s12, %s12, (32)0
; GENDYNPIC-NEXT: lea.sl %s12, __tls_get_addr@plt_hi(%s10, %s12)
; GENDYNPIC-NEXT: bsic %s10, (, %s12)
; GENDYNPIC-NEXT: or %s11, 0, %s9
;
; LOCAL-LABEL: get_local:
; LOCAL: .LBB{{[0-9]+}}_2:
; LOCAL-NEXT: lea %s34, y@tpoff_lo
; LOCAL-NEXT: and %s34, %s34, (32)0
; LOCAL-NEXT: lea.sl %s34, y@tpoff_hi(%s34)
; LOCAL-NEXT: adds.l %s0, %s14, %s34
; LOCAL-NEXT: or %s11, 0, %s9
entry:
ret ptr @y
}
; Function Attrs: norecurse nounwind
define void @set_global(i32 %v) {
; GENDYN-LABEL: set_global:
; GENDYN: .LBB{{[0-9]+}}_2:
; GENDYN-NEXT: st %s18, 288(, %s11) # 8-byte Folded Spill
; GENDYN-NEXT: or %s18, 0, %s0
; GENDYN-NEXT: lea %s0, x@tls_gd_lo(-24)
; GENDYN-NEXT: and %s0, %s0, (32)0
; GENDYN-NEXT: sic %s10
; GENDYN-NEXT: lea.sl %s0, x@tls_gd_hi(%s10, %s0)
; GENDYN-NEXT: lea %s12, __tls_get_addr@plt_lo(8)
; GENDYN-NEXT: and %s12, %s12, (32)0
; GENDYN-NEXT: lea.sl %s12, __tls_get_addr@plt_hi(%s10, %s12)
; GENDYN-NEXT: bsic %s10, (, %s12)
; GENDYN-NEXT: stl %s18, (, %s0)
; GENDYN-NEXT: ld %s18, 288(, %s11) # 8-byte Folded Reload
; GENDYN-NEXT: or %s11, 0, %s9
;
; GENDYNPIC-LABEL: set_global:
; GENDYNPIC: .LBB{{[0-9]+}}_2:
; GENDYNPIC-NEXT: st %s18, 288(, %s11) # 8-byte Folded Spill
; GENDYNPIC-NEXT: or %s18, 0, %s0
; GENDYNPIC-NEXT: lea %s15, _GLOBAL_OFFSET_TABLE_@pc_lo(-24)
; GENDYNPIC-NEXT: and %s15, %s15, (32)0
; GENDYNPIC-NEXT: sic %s16
; GENDYNPIC-NEXT: lea.sl %s15, _GLOBAL_OFFSET_TABLE_@pc_hi(%s16, %s15)
; GENDYNPIC-NEXT: lea %s0, x@tls_gd_lo(-24)
; GENDYNPIC-NEXT: and %s0, %s0, (32)0
; GENDYNPIC-NEXT: sic %s10
; GENDYNPIC-NEXT: lea.sl %s0, x@tls_gd_hi(%s10, %s0)
; GENDYNPIC-NEXT: lea %s12, __tls_get_addr@plt_lo(8)
; GENDYNPIC-NEXT: and %s12, %s12, (32)0
; GENDYNPIC-NEXT: lea.sl %s12, __tls_get_addr@plt_hi(%s10, %s12)
; GENDYNPIC-NEXT: bsic %s10, (, %s12)
; GENDYNPIC-NEXT: stl %s18, (, %s0)
; GENDYNPIC-NEXT: ld %s18, 288(, %s11) # 8-byte Folded Reload
; GENDYNPIC-NEXT: or %s11, 0, %s9
;
; LOCAL-LABEL: set_global:
; LOCAL: .LBB{{[0-9]+}}_2:
; LOCAL-NEXT: lea %s34, x@tpoff_lo
; LOCAL-NEXT: and %s34, %s34, (32)0
; LOCAL-NEXT: lea.sl %s34, x@tpoff_hi(%s34)
; LOCAL-NEXT: adds.l %s34, %s14, %s34
; LOCAL-NEXT: stl %s0, (, %s34)
; LOCAL-NEXT: or %s11, 0, %s9
entry:
store i32 %v, ptr @x, align 4
ret void
}
; Function Attrs: norecurse nounwind
define void @set_local(i32 %v) {
; GENDYN-LABEL: set_local:
; GENDYN: .LBB{{[0-9]+}}_2:
; GENDYN-NEXT: st %s18, 288(, %s11) # 8-byte Folded Spill
; GENDYN-NEXT: or %s18, 0, %s0
; GENDYN-NEXT: lea %s0, y@tls_gd_lo(-24)
; GENDYN-NEXT: and %s0, %s0, (32)0
; GENDYN-NEXT: sic %s10
; GENDYN-NEXT: lea.sl %s0, y@tls_gd_hi(%s10, %s0)
; GENDYN-NEXT: lea %s12, __tls_get_addr@plt_lo(8)
; GENDYN-NEXT: and %s12, %s12, (32)0
; GENDYN-NEXT: lea.sl %s12, __tls_get_addr@plt_hi(%s10, %s12)
; GENDYN-NEXT: bsic %s10, (, %s12)
; GENDYN-NEXT: stl %s18, (, %s0)
; GENDYN-NEXT: ld %s18, 288(, %s11) # 8-byte Folded Reload
; GENDYN-NEXT: or %s11, 0, %s9
;
; GENDYNPIC-LABEL: set_local:
; GENDYNPIC: .LBB{{[0-9]+}}_2:
; GENDYNPIC-NEXT: st %s18, 288(, %s11) # 8-byte Folded Spill
; GENDYNPIC-NEXT: or %s18, 0, %s0
; GENDYNPIC-NEXT: lea %s15, _GLOBAL_OFFSET_TABLE_@pc_lo(-24)
; GENDYNPIC-NEXT: and %s15, %s15, (32)0
; GENDYNPIC-NEXT: sic %s16
; GENDYNPIC-NEXT: lea.sl %s15, _GLOBAL_OFFSET_TABLE_@pc_hi(%s16, %s15)
; GENDYNPIC-NEXT: lea %s0, y@tls_gd_lo(-24)
; GENDYNPIC-NEXT: and %s0, %s0, (32)0
; GENDYNPIC-NEXT: sic %s10
; GENDYNPIC-NEXT: lea.sl %s0, y@tls_gd_hi(%s10, %s0)
; GENDYNPIC-NEXT: lea %s12, __tls_get_addr@plt_lo(8)
; GENDYNPIC-NEXT: and %s12, %s12, (32)0
; GENDYNPIC-NEXT: lea.sl %s12, __tls_get_addr@plt_hi(%s10, %s12)
; GENDYNPIC-NEXT: bsic %s10, (, %s12)
; GENDYNPIC-NEXT: stl %s18, (, %s0)
; GENDYNPIC-NEXT: ld %s18, 288(, %s11) # 8-byte Folded Reload
; GENDYNPIC-NEXT: or %s11, 0, %s9
;
; LOCAL-LABEL: set_local:
; LOCAL: .LBB{{[0-9]+}}_2:
; LOCAL-NEXT: lea %s34, y@tpoff_lo
; LOCAL-NEXT: and %s34, %s34, (32)0
; LOCAL-NEXT: lea.sl %s34, y@tpoff_hi(%s34)
; LOCAL-NEXT: adds.l %s34, %s14, %s34
; LOCAL-NEXT: stl %s0, (, %s34)
; LOCAL-NEXT: or %s11, 0, %s9
entry:
store i32 %v, ptr @y, align 4
ret void
}