Files
TheRock/compiler/amd-llvm/mlir/test/Conversion/FuncToSPIRV/func-ops-to-spirv.mlir
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

64 lines
1.9 KiB
MLIR

// RUN: mlir-opt -split-input-file -convert-func-to-spirv -verify-diagnostics %s | FileCheck %s
//===----------------------------------------------------------------------===//
// func.return
//===----------------------------------------------------------------------===//
module attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.0, [], []>, #spirv.resource_limits<>>
} {
// CHECK-LABEL: spirv.func @return_none_val
func.func @return_none_val() {
// CHECK: spirv.Return
return
}
// CHECK-LABEL: spirv.func @return_one_val
// CHECK-SAME: (%[[ARG:.+]]: f32)
func.func @return_one_val(%arg0: f32) -> f32 {
// CHECK: spirv.ReturnValue %[[ARG]] : f32
return %arg0: f32
}
// Check that multiple-return functions are not converted.
// CHECK-LABEL: func @return_multi_val
func.func @return_multi_val(%arg0: f32) -> (f32, f32) {
// CHECK: return
return %arg0, %arg0: f32, f32
}
// CHECK-LABEL: spirv.func @return_one_index
// CHECK-SAME: (%[[ARG:.+]]: i32)
func.func @return_one_index(%arg0: index) -> index {
// CHECK: spirv.ReturnValue %[[ARG]] : i32
return %arg0: index
}
// CHECK-LABEL: spirv.func @call_functions
// CHECK-SAME: (%[[ARG:.+]]: i32)
func.func @call_functions(%arg0: index) -> index {
// CHECK: spirv.FunctionCall @return_none_val() : () -> ()
call @return_none_val(): () -> ()
// CHECK: {{%.*}} = spirv.FunctionCall @return_one_index(%[[ARG]]) : (i32) -> i32
%0 = call @return_one_index(%arg0): (index) -> index
// CHECK: spirv.ReturnValue {{%.*}} : i32
return %0: index
}
}
// -----
func.func @dim_index_out_of_bounds() {
%c6 = arith.constant 6 : index
%alloc_4 = memref.alloc() : memref<4xi64>
%dim = memref.dim %alloc_4, %c6 : memref<4xi64>
%alloca_100 = memref.alloca() : memref<100xi64>
// expected-error@+1 {{'affine.vector_load' op operand cannot be used as a dimension id}}
%70 = affine.vector_load %alloca_100[%dim] : memref<100xi64>, vector<31xi64>
return
}
// -----