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

87 lines
3.9 KiB
LLVM

; For ELFv2 ABI, we can avoid allocating the parameter area in the stack frame of the caller function
; if all the arguments can be passed to the callee in registers.
; For ELFv1 ABI, we always need to allocate the parameter area.
; Tests for ELFv2 ABI
; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=PPC64-ELFV2
; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=PPC64-ELFV2
; Tests for ELFv1 ABI
; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=PPC64-ELFV1
; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=PPC64-ELFV1
; If the callee has at most eight integer args, parameter area can be ommited for ELFv2 ABI.
; PPC64-ELFV2-LABEL: WithoutParamArea1:
; PPC64-ELFV2-NOT: stw {{[0-9]+}}, -{{[0-9]+}}(1)
; PPC64-ELFV2: stdu 1, -32(1)
; PPC64-ELFV2: addi 1, 1, 32
; PPC64-ELFV2-NOT: lwz {{[0-9]+}}, -{{[0-9]+}}(1)
; PPC64-ELFV1-LABEL: WithoutParamArea1:
; PPC64-ELFV1-NOT: stw {{[0-9]+}}, -{{[0-9]+}}(1)
; PPC64-ELFV1: stdu 1, -112(1)
; PPC64-ELFV1: addi 1, 1, 112
; PPC64-ELFV1-NOT: lwz {{[0-9]+}}, -{{[0-9]+}}(1)
define signext i32 @WithoutParamArea1(i32 signext %a) local_unnamed_addr #0 {
entry:
%call = tail call signext i32 @onearg(i32 signext %a) #2
ret i32 %call
}
; PPC64-ELFV2-LABEL: WithoutParamArea2:
; PPC64-ELFV2-NOT: stw {{[0-9]+}}, -{{[0-9]+}}(1)
; PPC64-ELFV2: stdu 1, -32(1)
; PPC64-ELFV2: addi 1, 1, 32
; PPC64-ELFV2-NOT: lwz {{[0-9]+}}, -{{[0-9]+}}(1)
; PPC64-ELFV1-LABEL: WithoutParamArea2:
; PPC64-ELFV1-NOT: stw {{[0-9]+}}, -{{[0-9]+}}(1)
; PPC64-ELFV1: stdu 1, -112(1)
; PPC64-ELFV1: addi 1, 1, 112
; PPC64-ELFV1-NOT: lwz {{[0-9]+}}, -{{[0-9]+}}(1)
define signext i32 @WithoutParamArea2(i32 signext %a) local_unnamed_addr #0 {
entry:
%call = tail call signext i32 @eightargs(i32 signext %a, i32 signext %a, i32 signext %a, i32 signext %a, i32 signext %a, i32 signext %a, i32 signext %a, i32 signext %a) #2
ret i32 %call
}
; If the callee has more than eight integer args or variable number of args,
; parameter area cannot be ommited even for ELFv2 ABI
; PPC64-ELFV2-LABEL: WithParamArea1:
; PPC64-ELFV2-NOT: stw {{[0-9]+}}, -{{[0-9]+}}(1)
; PPC64-ELFV2: stdu 1, -96(1)
; PPC64-ELFV2: addi 1, 1, 96
; PPC64-ELFV2-NOT: lwz {{[0-9]+}}, -{{[0-9]+}}(1)
; PPC64-ELFV1-LABEL: WithParamArea1:
; PPC64-ELFV1-NOT: stw {{[0-9]+}}, -{{[0-9]+}}(1)
; PPC64-ELFV1: stdu 1, -112(1)
; PPC64-ELFV1: addi 1, 1, 112
; PPC64-ELFV1-NOT: lwz {{[0-9]+}}, -{{[0-9]+}}(1)
define signext i32 @WithParamArea1(i32 signext %a) local_unnamed_addr #0 {
entry:
%call = tail call signext i32 (i32, ...) @varargs(i32 signext %a, i32 signext %a) #2
ret i32 %call
}
; PPC64-ELFV2-LABEL: WithParamArea2:
; PPC64-ELFV2-NOT: stw {{[0-9]+}}, -{{[0-9]+}}(1)
; PPC64-ELFV2: stdu 1, -112(1)
; PPC64-ELFV2: addi 1, 1, 112
; PPC64-ELFV2-NOT: lwz {{[0-9]+}}, -{{[0-9]+}}(1)
; PPC64-ELFV1-LABEL: WithParamArea2:
; PPC64-ELFV1-NOT: stw {{[0-9]+}}, -{{[0-9]+}}(1)
; PPC64-ELFV1: stdu 1, -128(1)
; PPC64-ELFV1: addi 1, 1, 128
; PPC64-ELFV1-NOT: lwz {{[0-9]+}}, -{{[0-9]+}}(1)
define signext i32 @WithParamArea2(i32 signext %a) local_unnamed_addr #0 {
entry:
%call = tail call signext i32 @nineargs(i32 signext %a, i32 signext %a, i32 signext %a, i32 signext %a, i32 signext %a, i32 signext %a, i32 signext %a, i32 signext %a, i32 signext %a) #2
ret i32 %call
}
declare signext i32 @onearg(i32 signext) local_unnamed_addr #1
declare signext i32 @eightargs(i32 signext, i32 signext, i32 signext, i32 signext, i32 signext, i32 signext, i32 signext, i32 signext) local_unnamed_addr #1
declare signext i32 @nineargs(i32 signext, i32 signext, i32 signext, i32 signext, i32 signext, i32 signext, i32 signext, i32 signext, i32 signext) local_unnamed_addr #1
declare signext i32 @varargs(i32 signext, ...) local_unnamed_addr #1