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

119 lines
3.5 KiB
LLVM

; RUN: llc < %s -mtriple=nvptx64 -mcpu=sm_20 | FileCheck %s --check-prefixes=CHECK,NOALIGN4
; RUN: llc < %s -mtriple=nvptx64 -mcpu=sm_20 -nvptx-force-min-byval-param-align | FileCheck %s --check-prefixes=CHECK,ALIGN4
; RUN: %if ptxas %{ llc < %s -mtriple=nvptx64 -mcpu=sm_20 | %ptxas-verify %}
; RUN: %if ptxas %{ llc < %s -mtriple=nvptx64 -mcpu=sm_20 -nvptx-force-min-byval-param-align | %ptxas-verify %}
;;; Need 4-byte alignment on ptr passed byval
define ptx_device void @t1(ptr byval(float) %x) {
; CHECK: .func t1
; CHECK: .param .align 4 .b8 t1_param_0[4]
ret void
}
;;; Need 8-byte alignment on ptr passed byval
define ptx_device void @t2(ptr byval(double) %x) {
; CHECK: .func t2
; CHECK: .param .align 8 .b8 t2_param_0[8]
ret void
}
;;; Need 4-byte alignment on float2* passed byval
%struct.float2 = type { float, float }
define ptx_device void @t3(ptr byval(%struct.float2) %x) {
; CHECK: .func t3
; CHECK: .param .align 4 .b8 t3_param_0[8]
ret void
}
define ptx_device void @t4(ptr byval(i8) %x) {
; CHECK: .func t4
; NOALIGN4: .param .align 1 .b8 t4_param_0[1]
; ALIGN4: .param .align 4 .b8 t4_param_0[1]
ret void
}
;;; Make sure we adjust alignment at the call site as well.
define ptx_device void @t5(ptr align 2 byval(i8) %x) {
; CHECK: .func t5
; NOALIGN4: .param .align 2 .b8 t5_param_0[1]
; ALIGN4: .param .align 4 .b8 t5_param_0[1]
; CHECK: {
; NOALIGN4: .param .align 1 .b8 param0[1];
; ALIGN4: .param .align 4 .b8 param0[1];
; CHECK: call.uni
call void @t4(ptr byval(i8) %x)
ret void
}
;;; Make sure we adjust alignment for a function prototype
;;; in case of an inderect call.
declare ptr @getfp(i32 %n)
%struct.half2 = type { half, half }
define ptx_device void @t6() {
; CHECK: .func t6
%fp = call ptr @getfp(i32 0)
; CHECK: prototype_2 : .callprototype ()_ (.param .align 8 .b8 _[8]);
call void %fp(ptr byval(double) null);
%fp2 = call ptr @getfp(i32 1)
; NOALIGN4: prototype_4 : .callprototype ()_ (.param .align 2 .b8 _[4]);
; ALIGN4: prototype_4 : .callprototype ()_ (.param .align 4 .b8 _[4]);
call void %fp(ptr byval(%struct.half2) null);
%fp3 = call ptr @getfp(i32 2)
; NOALIGN4: prototype_6 : .callprototype ()_ (.param .align 1 .b8 _[1]);
; ALIGN4: prototype_6 : .callprototype ()_ (.param .align 4 .b8 _[1]);
call void %fp(ptr byval(i8) null);
ret void
}
; CHECK-LABEL: .func check_ptr_align1(
; CHECK: ld.param.b64 %rd1, [check_ptr_align1_param_0];
; CHECK-NOT: ld.param.b8
; CHECK: st.b8 [%rd1+3], 0;
; CHECK: st.b8 [%rd1+2], 0;
; CHECK: st.b8 [%rd1+1], 0;
; CHECK: st.b8 [%rd1], 1;
; CHECK: ret;
define void @check_ptr_align1(ptr align 1 %_arg_ptr) {
entry:
store i32 1, ptr %_arg_ptr, align 1
ret void
}
; CHECK-LABEL: .func check_ptr_align2(
; CHECK: ld.param.b64 %rd1, [check_ptr_align2_param_0];
; CHECK-NOT: ld.param.b16
; CHECK: st.b16 [%rd1+2], 0;
; CHECK: st.b16 [%rd1], 2;
; CHECK: ret;
define void @check_ptr_align2(ptr align 2 %_arg_ptr) {
entry:
store i32 2, ptr %_arg_ptr, align 2
ret void
}
; CHECK-LABEL: .func check_ptr_align4(
; CHECK: ld.param.b64 %rd1, [check_ptr_align4_param_0];
; CHECK-NOT: ld.param.b32
; CHECK: st.b32 [%rd1], 4;
; CHECK: ret;
define void @check_ptr_align4(ptr align 4 %_arg_ptr) {
entry:
store i32 4, ptr %_arg_ptr, align 4
ret void
}
; CHECK-LABEL: .func check_ptr_align8(
; CHECK: ld.param.b64 %rd1, [check_ptr_align8_param_0];
; CHECK: st.b32 [%rd1], 8;
; CHECK: ret;
define void @check_ptr_align8(ptr align 8 %_arg_ptr) {
entry:
store i32 8, ptr %_arg_ptr, align 8
ret void
}