Files
TheRock/compiler/amd-llvm/mlir/test/Dialect/Linalg/value-bounds-op-interface-impl.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

65 lines
2.2 KiB
MLIR

// RUN: mlir-opt %s -pass-pipeline='builtin.module(func.func(test-affine-reify-value-bounds))' -verify-diagnostics \
// RUN: -split-input-file | FileCheck %s
// CHECK-LABEL: func @linalg_fill(
// CHECK-SAME: %[[t:.*]]: tensor<?xf32>
// CHECK: %[[c0:.*]] = arith.constant 0 : index
// CHECK: %[[dim:.*]] = tensor.dim %[[t]], %[[c0]]
// CHECK: return %[[dim]]
func.func @linalg_fill(%t: tensor<?xf32>, %f: f32) -> index {
%0 = linalg.fill ins(%f : f32) outs(%t : tensor<?xf32>) -> tensor<?xf32>
%1 = "test.reify_bound"(%0) {dim = 0} : (tensor<?xf32>) -> (index)
return %1 : index
}
// -----
#accesses = [
affine_map<(i, j, k) -> (j, i)>,
affine_map<(i, j, k) -> (i, k, i + j)>
]
#trait = {
indexing_maps = #accesses,
iterator_types = ["parallel", "parallel", "parallel"]
}
// CHECK-LABEL: func @linalg_index(
// CHECK-SAME: %[[arg0:.*]]: memref<?x?xf32>
func.func @linalg_index(%arg0: memref<?x?xf32>,
%arg1: memref<?x5x?xf32>) {
linalg.generic #trait
ins(%arg0 : memref<?x?xf32>)
outs(%arg1 : memref<?x5x?xf32>)
{
^bb(%a: f32, %b: f32):
// CHECK: %[[c1:.*]] = arith.constant 1 : index
// CHECK: %[[ub_0:.*]] = memref.dim %[[arg0]], %[[c1]]
// CHECK: "test.some_use"(%[[ub_0]])
%0 = linalg.index 0 : index
%ub_0 = "test.reify_bound"(%0) {type = "UB"} : (index) -> (index)
"test.some_use"(%ub_0) : (index) -> ()
// CHECK: %[[c0:.*]] = arith.constant 0 : index
// CHECK: "test.some_use"(%[[c0]])
%lb_0 = "test.reify_bound"(%0) {type = "LB"} : (index) -> (index)
"test.some_use"(%lb_0) : (index) -> ()
// CHECK: %[[c0:.*]] = arith.constant 0 : index
// CHECK: %[[ub_1:.*]] = memref.dim %[[arg0]], %[[c0]]
// CHECK: "test.some_use"(%[[ub_1]])
%1 = linalg.index 1 : index
%ub_1 = "test.reify_bound"(%1) {type = "UB"} : (index) -> (index)
"test.some_use"(%ub_1) : (index) -> ()
// CHECK: %[[ub_2:.*]] = arith.constant 5 : index
// CHECK: "test.some_use"(%[[ub_2]])
%2 = linalg.index 2 : index
%ub_2 = "test.reify_bound"(%2) {type = "UB"} : (index) -> (index)
"test.some_use"(%ub_2) : (index) -> ()
linalg.yield %b : f32
}
return
}