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
121 lines
3.9 KiB
LLVM
121 lines
3.9 KiB
LLVM
; RUN: llc --mtriple=loongarch64 --relocation-model=pic \
|
|
; RUN: --code-model=medium < %s | FileCheck --check-prefix=MEDIUM %s
|
|
; RUN: llc --mtriple=loongarch64 --relocation-model=pic \
|
|
; RUN: --code-model=large < %s | FileCheck --check-prefix=LARGE %s
|
|
; RUN: llc --mtriple=loongarch64 --relocation-model=pic \
|
|
; RUN: --enable-tlsdesc --code-model=large < %s | \
|
|
; RUN: FileCheck --check-prefix=LARGEDESC %s
|
|
|
|
; Check the adjancency of pseudo-instruction expansions to ensure
|
|
; compliance with psABI requirements:
|
|
; https://github.com/loongson/la-abi-specs/releases/tag/v2.30
|
|
|
|
declare void @llvm.memset.p0.i64(ptr, i8, i64, i1)
|
|
|
|
define void @call_external_sym(ptr %dst) {
|
|
; LARGE-LABEL: call_external_sym:
|
|
; LARGE: pcalau12i [[REG1:\$[a-z0-9]+]], %got_pc_hi20(memset)
|
|
; LARGE-NEXT: addi.d [[REG2:\$[a-z0-9]+]], $zero, %got_pc_lo12(memset)
|
|
; LARGE-NEXT: lu32i.d [[REG2]], %got64_pc_lo20(memset)
|
|
; LARGE-NEXT: lu52i.d [[REG2]], [[REG2]], %got64_pc_hi12(memset)
|
|
entry:
|
|
call void @llvm.memset.p0.i64(ptr %dst, i8 0, i64 1000, i1 false)
|
|
ret void
|
|
}
|
|
|
|
declare i32 @callee_tail(i32 %i)
|
|
|
|
define i32 @caller_call_tail(i32 %i) nounwind {
|
|
; MEDIUM-LABEL: caller_call_tail:
|
|
; MEDIUM: pcaddu18i $t8, %call36(callee_tail)
|
|
; MEDIUM-NEXT: jr $t8
|
|
;
|
|
; LARGE-LABEL: caller_call_tail:
|
|
; LARGE: pcalau12i [[REG1:\$[a-z0-9]+]], %got_pc_hi20(callee_tail)
|
|
; LARGE-NEXT: addi.d [[REG2:\$[a-z0-9]+]], $zero, %got_pc_lo12(callee_tail)
|
|
; LARGE-NEXT: lu32i.d [[REG2]], %got64_pc_lo20(callee_tail)
|
|
; LARGE-NEXT: lu52i.d [[REG2]], [[REG2]], %got64_pc_hi12(callee_tail)
|
|
entry:
|
|
call i32 @callee_tail(i32 %i)
|
|
%r = tail call i32 @callee_tail(i32 %i)
|
|
ret i32 %r
|
|
}
|
|
|
|
@ie = external thread_local(initialexec) global i32
|
|
|
|
define void @test_la_tls_ie(i32 signext %n) {
|
|
; LARGE-LABEL: test_la_tls_ie:
|
|
; LARGE: pcalau12i [[REG1:\$[a-z0-9]+]], %ie_pc_hi20(ie)
|
|
; LARGE-NEXT: addi.d [[REG2:\$[a-z0-9]+]], $zero, %ie_pc_lo12(ie)
|
|
; LARGE-NEXT: lu32i.d [[REG2]], %ie64_pc_lo20(ie)
|
|
; LARGE-NEXT: lu52i.d [[REG2]], [[REG2]], %ie64_pc_hi12(ie)
|
|
entry:
|
|
br label %loop
|
|
|
|
loop:
|
|
%i = phi i32 [ %inc, %loop ], [ 0, %entry ]
|
|
%0 = load volatile i32, ptr @ie, align 4
|
|
%inc = add nuw nsw i32 %i, 1
|
|
%cmp = icmp slt i32 %inc, %n
|
|
br i1 %cmp, label %loop, label %ret
|
|
|
|
ret:
|
|
ret void
|
|
}
|
|
|
|
@ld = external thread_local(localdynamic) global i32
|
|
|
|
define void @test_la_tls_ld(i32 signext %n) {
|
|
; LARGE-LABEL: test_la_tls_ld:
|
|
; LARGE: pcalau12i [[REG1:\$[a-z0-9]+]], %ld_pc_hi20(ld)
|
|
; LARGE-NEXT: addi.d [[REG2:\$[a-z0-9]+]], $zero, %got_pc_lo12(ld)
|
|
; LARGE-NEXT: lu32i.d [[REG2]], %got64_pc_lo20(ld)
|
|
; LARGE-NEXT: lu52i.d [[REG2]], [[REG2]], %got64_pc_hi12(ld)
|
|
entry:
|
|
br label %loop
|
|
|
|
loop:
|
|
%i = phi i32 [ %inc, %loop ], [ 0, %entry ]
|
|
%0 = load volatile i32, ptr @ld, align 4
|
|
%inc = add nuw nsw i32 %i, 1
|
|
%cmp = icmp slt i32 %inc, %n
|
|
br i1 %cmp, label %loop, label %ret
|
|
|
|
ret:
|
|
ret void
|
|
}
|
|
|
|
@gd = external thread_local global i32
|
|
|
|
define void @test_la_tls_gd(i32 signext %n) nounwind {
|
|
; LARGE-LABEL: test_la_tls_gd:
|
|
; LARGE: pcalau12i [[REG1:\$[a-z0-9]+]], %gd_pc_hi20(gd)
|
|
; LARGE-NEXT: addi.d [[REG2:\$[a-z0-9]+]], $zero, %got_pc_lo12(gd)
|
|
; LARGE-NEXT: lu32i.d [[REG2]], %got64_pc_lo20(gd)
|
|
; LARGE-NEXT: lu52i.d [[REG2]], [[REG2]], %got64_pc_hi12(gd)
|
|
entry:
|
|
br label %loop
|
|
|
|
loop:
|
|
%i = phi i32 [ %inc, %loop ], [ 0, %entry ]
|
|
%0 = load volatile i32, ptr @gd, align 4
|
|
%inc = add nuw nsw i32 %i, 1
|
|
%cmp = icmp slt i32 %inc, %n
|
|
br i1 %cmp, label %loop, label %ret
|
|
|
|
ret:
|
|
ret void
|
|
}
|
|
|
|
@unspecified = external thread_local global i32
|
|
|
|
define ptr @test_la_tls_desc() nounwind {
|
|
; LARGEDESC-LABEL: test_la_tls_desc:
|
|
; LARGEDESC: pcalau12i [[REG1:\$[a-z0-9]+]], %desc_pc_hi20(unspecified)
|
|
; LARGEDESC-NEXT: addi.d [[REG2:\$[a-z0-9]+]], $zero, %desc_pc_lo12(unspecified)
|
|
; LARGEDESC-NEXT: lu32i.d [[REG2]], %desc64_pc_lo20(unspecified)
|
|
; LARGEDESC-NEXT: lu52i.d [[REG2]], [[REG2]], %desc64_pc_hi12(unspecified)
|
|
entry:
|
|
ret ptr @unspecified
|
|
}
|