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

117 lines
4.0 KiB
LLVM

; RUN: llvm-as %s -o %t.bc
; RUN: llvm-spirv %t.bc -o %t.spv --spirv-fp-contract=on
; RUN: llvm-spirv %t.spv -to-text -o - | FileCheck %s
; RUN: spirv-val %t.spv
; CHECK: EntryPoint 6 [[K1:[0-9]+]] "kernel_off_1"
; CHECK: EntryPoint 6 [[K2:[0-9]+]] "kernel_off_2"
; CHECK: EntryPoint 6 [[K3:[0-9]+]] "kernel_off_3"
; CHECK: EntryPoint 6 [[K4:[0-9]+]] "kernel_off_4"
; CHECK: EntryPoint 6 [[K5:[0-9]+]] "kernel_off_5"
; CHECK: EntryPoint 6 [[K6:[0-9]+]] "kernel_off_6"
; CHECK: EntryPoint 6 [[K7:[0-9]+]] "kernel_on_7"
; CHECK: ExecutionMode [[K1]] 31
; CHECK: ExecutionMode [[K2]] 31
; CHECK: ExecutionMode [[K3]] 31
; CHECK: ExecutionMode [[K4]] 31
; CHECK: ExecutionMode [[K5]] 31
; CHECK: ExecutionMode [[K6]] 31
; CHECK-NOT: ExecutionMode [[K7]] 31
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
target triple = "spir64"
define float @func_nested_off(float %a, float %b, float %c) {
entry:
%0 = call float @func_off(float %a, float %b, float %c)
ret float %0
}
define float @func_off(float %a, float %b, float %c) {
entry:
%0 = call float @llvm.fmuladd.f32(float %a, float %b, float %c)
%mul = fmul float %0, %b
%add = fadd float %mul, %c
ret float %add
}
declare float @llvm.fmuladd.f32(float, float, float) #0
define float @func_on(float %a, float %b, float %c) {
entry:
%0 = call float @llvm.fmuladd.f32(float %a, float %b, float %c)
ret float %0
}
define float @func_mul(float %a, float %b) {
entry:
%0 = fmul float %a, %b
ret float %0
}
declare float @func_extern(float, float, float)
define spir_kernel void @kernel_off_1(float %a, float %b, float %c) !kernel_arg_addr_space !3 !kernel_arg_access_qual !4 !kernel_arg_type !5 !kernel_arg_base_type !5 !kernel_arg_type_qual !6 {
entry:
%mul = fmul float %a, %b
%add = fadd float %mul, %c
ret void
}
define spir_kernel void @kernel_off_2(float %a, float %b, float %c) !kernel_arg_addr_space !3 !kernel_arg_access_qual !4 !kernel_arg_type !5 !kernel_arg_base_type !5 !kernel_arg_type_qual !6 {
entry:
%0 = call float @llvm.fmuladd.f32(float %a, float %b, float %c)
%call = call float @func_off(float %0, float %b, float %c)
ret void
}
define spir_kernel void @kernel_off_3(float %a, float %b, float %c) !kernel_arg_addr_space !3 !kernel_arg_access_qual !4 !kernel_arg_type !5 !kernel_arg_base_type !5 !kernel_arg_type_qual !6 {
entry:
%call = call float @func_nested_off(float %a, float %b, float %c)
ret void
}
define spir_kernel void @kernel_off_4(float %a, float %b, float %c) !kernel_arg_addr_space !3 !kernel_arg_access_qual !4 !kernel_arg_type !5 !kernel_arg_base_type !5 !kernel_arg_type_qual !6 {
entry:
%0 = call float @llvm.fmuladd.f32(float %a, float %b, float %c)
%call = call float @func_extern(float %0, float %b, float %c)
ret void
}
define spir_kernel void @kernel_off_5(float %a, float %b, float %c) !kernel_arg_addr_space !3 !kernel_arg_access_qual !4 !kernel_arg_type !5 !kernel_arg_base_type !5 !kernel_arg_type_qual !6 {
entry:
%mul = call float @func_off(float %a, float %b, float %c)
%add = fadd contract float %mul, %c
ret void
}
define spir_kernel void @kernel_off_6(float %a, float %b, float %c) !kernel_arg_addr_space !3 !kernel_arg_access_qual !4 !kernel_arg_type !5 !kernel_arg_base_type !5 !kernel_arg_type_qual !6 {
entry:
%mul = call float @func_mul(float %a, float %b)
%add = fadd float %mul, %c
ret void
}
define spir_kernel void @kernel_on_7(float %a, float %b, float %c) !kernel_arg_addr_space !3 !kernel_arg_access_qual !4 !kernel_arg_type !5 !kernel_arg_base_type !5 !kernel_arg_type_qual !6 {
entry:
%mul = call float @func_mul(float %a, float %b)
%add = fadd contract float %mul, %c
ret void
}
attributes #0 = { nounwind readnone speculatable willreturn }
!llvm.module.flags = !{!0}
!opencl.ocl.version = !{!1}
!llvm.ident = !{!2}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 1, i32 0}
!2 = !{!"clang version 11.0.0"}
!3 = !{i32 0, i32 0, i32 0}
!4 = !{!"none", !"none", !"none"}
!5 = !{!"float", !"float", !"float"}
!6 = !{!"", !"", !""}