Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/RISCV/rvv/musttail-indirect-args.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

72 lines
3.5 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
; RUN: llc -mtriple=riscv32 -mattr=+m,+v %s -o - | FileCheck %s --check-prefixes=CHECK,RV32
; RUN: llc -mtriple=riscv64 -mattr=+m,+v %s -o - | FileCheck %s --check-prefixes=CHECK,RV64
; Companion to musttail-indirect-args.ll for scalable vector args.
; <vscale x 32 x i32> is too large to fit in v8-v23, so it is split into
; multiple parts and the callee receives a pointer to the parts via
; CCValAssign::Indirect. The musttail computed-arg path must scale per-part
; offsets by VSCALE -- mirrors the non-musttail spill path validated by
; calling-conv.ll's caller_scalable_vector_split_indirect.
declare <vscale x 32 x i32> @callee_musttail_scalable(<vscale x 32 x i32> %x, <vscale x 32 x i32> %y)
; Forwarded: both args are caller formals passed straight through. The
; incoming indirect pointers are forwarded zero-copy; no per-part offset
; computation happens in the caller, so VSCALE does not enter here.
define <vscale x 32 x i32> @caller_musttail_scalable_forwarded(<vscale x 32 x i32> %x, <vscale x 32 x i32> %y) nounwind {
; CHECK-LABEL: caller_musttail_scalable_forwarded:
; CHECK: # %bb.0:
; CHECK-NEXT: tail callee_musttail_scalable
%r = musttail call <vscale x 32 x i32> @callee_musttail_scalable(<vscale x 32 x i32> %x, <vscale x 32 x i32> %y)
ret <vscale x 32 x i32> %r
}
; Computed: both args are arithmetic on the formals, so dyn_cast<Argument>
; fails and we go through the store-into-incoming-pointer path. The
; second part's store must use VSCALE * PartOffset relative to
; IncomingPtr, otherwise the part lands at a fixed byte offset that
; differs from what the callee expects (vlenb * 8 above).
define <vscale x 32 x i32> @caller_musttail_scalable_computed(<vscale x 32 x i32> %x, <vscale x 32 x i32> %y) nounwind {
; CHECK-LABEL: caller_musttail_scalable_computed:
; CHECK: # %bb.0:
; CHECK-NEXT: csrr a1, vlenb
; CHECK-NEXT: slli a1, a1, 3
; CHECK-NEXT: vl8re32.v v24, (a0)
; CHECK-NEXT: add a1, a0, a1
; CHECK-NEXT: vl8re32.v v0, (a1)
; CHECK-NEXT: vsetvli a2, zero, e32, m8, ta, ma
; CHECK-NEXT: vadd.vv v8, v8, v24
; CHECK-NEXT: vs8r.v v8, (a0)
; CHECK-NEXT: vadd.vv v16, v16, v0
; CHECK-NEXT: vs8r.v v16, (a1)
; CHECK-NEXT: tail callee_musttail_scalable
%s = add <vscale x 32 x i32> %x, %y
%r = musttail call <vscale x 32 x i32> @callee_musttail_scalable(<vscale x 32 x i32> %s, <vscale x 32 x i32> %s)
ret <vscale x 32 x i32> %r
}
; Mixed: first arg forwarded, second arg computed. Exercises both branches
; of the formal-arg-vs-computed path on the same call.
define <vscale x 32 x i32> @caller_musttail_scalable_mixed(<vscale x 32 x i32> %x, <vscale x 32 x i32> %y) nounwind {
; CHECK-LABEL: caller_musttail_scalable_mixed:
; CHECK: # %bb.0:
; CHECK-NEXT: csrr a1, vlenb
; CHECK-NEXT: slli a1, a1, 3
; CHECK-NEXT: vl8re32.v v24, (a0)
; CHECK-NEXT: add a1, a0, a1
; CHECK-NEXT: vl8re32.v v0, (a1)
; CHECK-NEXT: vsetvli a2, zero, e32, m8, ta, ma
; CHECK-NEXT: vadd.vv v24, v8, v24
; CHECK-NEXT: vs8r.v v24, (a0)
; CHECK-NEXT: vadd.vv v24, v16, v0
; CHECK-NEXT: vs8r.v v24, (a1)
; CHECK-NEXT: tail callee_musttail_scalable
%s = add <vscale x 32 x i32> %x, %y
%r = musttail call <vscale x 32 x i32> @callee_musttail_scalable(<vscale x 32 x i32> %x, <vscale x 32 x i32> %s)
ret <vscale x 32 x i32> %r
}
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; RV32: {{.*}}
; RV64: {{.*}}