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
139 lines
7.5 KiB
LLVM
139 lines
7.5 KiB
LLVM
; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv-vulkan-library %s -o - | FileCheck %s
|
|
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-vulkan-library %s -o - -filetype=obj | spirv-val %}
|
|
|
|
@.str.b0 = private unnamed_addr constant [3 x i8] c"B0\00", align 1
|
|
|
|
; CHECK-DAG: [[float:%[0-9]+]] = OpTypeFloat 32
|
|
; CHECK-DAG: [[v2float:%[0-9]+]] = OpTypeVector [[float]] 2
|
|
; CHECK-DAG: [[v4float:%[0-9]+]] = OpTypeVector [[float]] 4
|
|
; CHECK-DAG: [[int:%[0-9]+]] = OpTypeInt 32 0
|
|
; CHECK-DAG: [[zero:%[0-9]+]] = OpConstant [[int]] 0
|
|
; CHECK-DAG: [[one:%[0-9]+]] = OpConstant [[int]] 1
|
|
; CHECK-DAG: [[twenty:%[0-9]+]] = OpConstant [[int]] 20
|
|
; CHECK-DAG: [[twenty_three:%[0-9]+]] = OpConstant [[int]] 23
|
|
; CHECK-DAG: [[ImageType:%[0-9]+]] = OpTypeImage [[float]] Buffer 2 0 0 2 Rgba32f
|
|
; CHECK-DAG: [[ImagePtr:%[0-9]+]] = OpTypePointer UniformConstant [[ImageType]]
|
|
; CHECK-DAG: [[Var:%[0-9]+]] = OpVariable [[ImagePtr]] UniformConstant
|
|
|
|
; Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none)
|
|
; CHECK: OpFunction
|
|
define void @main_scalar() local_unnamed_addr #0 {
|
|
entry:
|
|
; CHECK: [[H:%[0-9]+]] = OpLoad [[ImageType]] [[Var]]
|
|
%s_h.i = tail call target("spirv.Image", float, 5, 2, 0, 0, 2, 1) @llvm.spv.resource.handlefrombinding.tspirv.Image_f32_5_2_0_0_2_0t(i32 3, i32 5, i32 1, i32 0, ptr nonnull @.str.b0)
|
|
|
|
; CHECK: [[R:%[0-9]+]] = OpImageRead [[v4float]] [[H]] [[one]]
|
|
; CHECK: [[V:%[0-9]+]] = OpCompositeExtract [[float]] [[R]] 0
|
|
%0 = tail call noundef nonnull align 4 dereferenceable(4) ptr @llvm.spv.resource.getpointer.p0.tspirv.Image_f32_5_2_0_0_2_0t(target("spirv.Image", float, 5, 2, 0, 0, 2, 1) %s_h.i, i32 1)
|
|
%1 = load float, ptr %0, align 4
|
|
; CHECK: OpBranch [[bb_store:%[0-9]+]]
|
|
br label %bb_store
|
|
|
|
; CHECK: [[bb_store]] = OpLabel
|
|
bb_store:
|
|
|
|
; CHECK: [[H:%[0-9]+]] = OpLoad [[ImageType]] [[Var]]
|
|
; CHECK: OpImageWrite [[H]] [[zero]] [[V]]
|
|
%2 = tail call noundef nonnull align 4 dereferenceable(4) ptr @llvm.spv.resource.getpointer.p0.tspirv.Image_f32_5_2_0_0_2_0t(target("spirv.Image", float, 5, 2, 0, 0, 2, 1) %s_h.i, i32 0)
|
|
store float %1, ptr %2, align 4
|
|
; CHECK: OpBranch [[bb_both:%[0-9]+]]
|
|
br label %bb_both
|
|
|
|
; CHECK: [[bb_both]] = OpLabel
|
|
bb_both:
|
|
; CHECK: [[H:%[0-9]+]] = OpLoad [[ImageType]] [[Var]]
|
|
; CHECK: [[R:%[0-9]+]] = OpImageRead [[v4float]] [[H]] [[twenty_three]]
|
|
; CHECK: [[V:%[0-9]+]] = OpCompositeExtract [[float]] [[R]] 0
|
|
%3 = tail call noundef nonnull align 4 dereferenceable(4) ptr @llvm.spv.resource.getpointer.p0.tspirv.Image_f32_5_2_0_0_2_0t(target("spirv.Image", float, 5, 2, 0, 0, 2, 1) %s_h.i, i32 23)
|
|
%4 = load float, ptr %3, align 4
|
|
|
|
; CHECK: [[H:%[0-9]+]] = OpLoad [[ImageType]] [[Var]]
|
|
; CHECK: OpImageWrite [[H]] [[twenty]] [[V]]
|
|
%5 = tail call noundef nonnull align 4 dereferenceable(4) ptr @llvm.spv.resource.getpointer.p0.tspirv.Image_f32_5_2_0_0_2_0t(target("spirv.Image", float, 5, 2, 0, 0, 2, 1) %s_h.i, i32 20)
|
|
store float %4, ptr %5, align 4
|
|
ret void
|
|
}
|
|
|
|
; Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none)
|
|
; CHECK: OpFunction
|
|
define void @main_vector2() local_unnamed_addr #0 {
|
|
entry:
|
|
; CHECK: [[H:%[0-9]+]] = OpLoad [[ImageType]] [[Var]]
|
|
%s_h.i = tail call target("spirv.Image", float, 5, 2, 0, 0, 2, 1) @llvm.spv.resource.handlefrombinding.tspirv.Image_f32_5_2_0_0_2_0t(i32 3, i32 5, i32 1, i32 0, ptr nonnull @.str.b0)
|
|
|
|
; CHECK: [[R:%[0-9]+]] = OpImageRead [[v4float]] [[H]] [[one]]
|
|
; CHECK: [[E0:%[0-9]+]] = OpCompositeExtract [[float]] [[R]] 0
|
|
; CHECK: [[E1:%[0-9]+]] = OpCompositeExtract [[float]] [[R]] 1
|
|
; CHECK: [[V:%[0-9]+]] = OpCompositeConstruct [[v2float]] [[E0]] [[E1]]
|
|
%0 = tail call noundef nonnull align 4 dereferenceable(4) ptr @llvm.spv.resource.getpointer.p0.tspirv.Image_f32_5_2_0_0_2_0t(target("spirv.Image", float, 5, 2, 0, 0, 2, 1) %s_h.i, i32 1)
|
|
%1 = load <2 x float>, ptr %0, align 4
|
|
; CHECK: OpBranch [[bb_store:%[0-9]+]]
|
|
br label %bb_store
|
|
|
|
; CHECK: [[bb_store]] = OpLabel
|
|
bb_store:
|
|
|
|
; CHECK: [[H:%[0-9]+]] = OpLoad [[ImageType]] [[Var]]
|
|
; CHECK: OpImageWrite [[H]] [[zero]] [[V]]
|
|
%2 = tail call noundef nonnull align 4 dereferenceable(4) ptr @llvm.spv.resource.getpointer.p0.tspirv.Image_f32_5_2_0_0_2_0t(target("spirv.Image", float, 5, 2, 0, 0, 2, 1) %s_h.i, i32 0)
|
|
store <2 x float> %1, ptr %2, align 4
|
|
; CHECK: OpBranch [[bb_both:%[0-9]+]]
|
|
br label %bb_both
|
|
|
|
; CHECK: [[bb_both]] = OpLabel
|
|
bb_both:
|
|
; CHECK: [[H:%[0-9]+]] = OpLoad [[ImageType]] [[Var]]
|
|
; CHECK: [[R:%[0-9]+]] = OpImageRead [[v4float]] [[H]] [[twenty_three]]
|
|
; CHECK: [[E0:%[0-9]+]] = OpCompositeExtract [[float]] [[R]] 0
|
|
; CHECK: [[E1:%[0-9]+]] = OpCompositeExtract [[float]] [[R]] 1
|
|
; CHECK: [[V:%[0-9]+]] = OpCompositeConstruct [[v2float]] [[E0]] [[E1]]
|
|
%3 = tail call noundef nonnull align 4 dereferenceable(4) ptr @llvm.spv.resource.getpointer.p0.tspirv.Image_f32_5_2_0_0_2_0t(target("spirv.Image", float, 5, 2, 0, 0, 2, 1) %s_h.i, i32 23)
|
|
%4 = load <2 x float>, ptr %3, align 4
|
|
|
|
; CHECK: [[H:%[0-9]+]] = OpLoad [[ImageType]] [[Var]]
|
|
; CHECK: OpImageWrite [[H]] [[twenty]] [[V]]
|
|
%5 = tail call noundef nonnull align 4 dereferenceable(4) ptr @llvm.spv.resource.getpointer.p0.tspirv.Image_f32_5_2_0_0_2_0t(target("spirv.Image", float, 5, 2, 0, 0, 2, 1) %s_h.i, i32 20)
|
|
store <2 x float> %4, ptr %5, align 4
|
|
ret void
|
|
}
|
|
|
|
; Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none)
|
|
; CHECK: OpFunction
|
|
define void @main_vector4() local_unnamed_addr #0 {
|
|
entry:
|
|
; CHECK: [[H:%[0-9]+]] = OpLoad [[ImageType]] [[Var]]
|
|
%s_h.i = tail call target("spirv.Image", float, 5, 2, 0, 0, 2, 1) @llvm.spv.resource.handlefrombinding.tspirv.Image_f32_5_2_0_0_2_0t(i32 3, i32 5, i32 1, i32 0, ptr nonnull @.str.b0)
|
|
|
|
; CHECK: [[R:%[0-9]+]] = OpImageRead [[v4float]] [[H]] [[one]]
|
|
%0 = tail call noundef nonnull align 4 dereferenceable(4) ptr @llvm.spv.resource.getpointer.p0.tspirv.Image_f32_5_2_0_0_2_0t(target("spirv.Image", float, 5, 2, 0, 0, 2, 1) %s_h.i, i32 1)
|
|
%1 = load <4 x float>, ptr %0, align 4
|
|
; CHECK: OpBranch [[bb_store:%[0-9]+]]
|
|
br label %bb_store
|
|
|
|
; CHECK: [[bb_store]] = OpLabel
|
|
bb_store:
|
|
|
|
; CHECK: [[H:%[0-9]+]] = OpLoad [[ImageType]] [[Var]]
|
|
; CHECK: OpImageWrite [[H]] [[zero]] [[R]]
|
|
%2 = tail call noundef nonnull align 4 dereferenceable(4) ptr @llvm.spv.resource.getpointer.p0.tspirv.Image_f32_5_2_0_0_2_0t(target("spirv.Image", float, 5, 2, 0, 0, 2, 1) %s_h.i, i32 0)
|
|
store <4 x float> %1, ptr %2, align 4
|
|
; CHECK: OpBranch [[bb_both:%[0-9]+]]
|
|
br label %bb_both
|
|
|
|
; CHECK: [[bb_both]] = OpLabel
|
|
bb_both:
|
|
; CHECK: [[H:%[0-9]+]] = OpLoad [[ImageType]] [[Var]]
|
|
; CHECK: [[R:%[0-9]+]] = OpImageRead [[v4float]] [[H]] [[twenty_three]]
|
|
%3 = tail call noundef nonnull align 4 dereferenceable(4) ptr @llvm.spv.resource.getpointer.p0.tspirv.Image_f32_5_2_0_0_2_0t(target("spirv.Image", float, 5, 2, 0, 0, 2, 1) %s_h.i, i32 23)
|
|
%4 = load <4 x float>, ptr %3, align 4
|
|
|
|
; CHECK: [[H:%[0-9]+]] = OpLoad [[ImageType]] [[Var]]
|
|
; CHECK: OpImageWrite [[H]] [[twenty]] [[R]]
|
|
%5 = tail call noundef nonnull align 4 dereferenceable(4) ptr @llvm.spv.resource.getpointer.p0.tspirv.Image_f32_5_2_0_0_2_0t(target("spirv.Image", float, 5, 2, 0, 0, 2, 1) %s_h.i, i32 20)
|
|
store <4 x float> %4, ptr %5, align 4
|
|
ret void
|
|
}
|
|
|
|
attributes #0 = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) "frame-pointer"="all" "hlsl.numthreads"="1,1,1" "hlsl.shader"="compute" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
|
|
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(none) }
|