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
75 lines
2.5 KiB
MLIR
75 lines
2.5 KiB
MLIR
// RUN: mlir-opt -int-range-optimizations --split-input-file %s | FileCheck %s
|
|
|
|
// CHECK-LABEL: @dim_const
|
|
// CHECK: %[[ret:.+]] = arith.constant 3 : index
|
|
// CHECK: return %[[ret]]
|
|
func.func @dim_const(%t: tensor<3x5xi32>) -> index {
|
|
%c0 = arith.constant 0 : index
|
|
%0 = tensor.dim %t, %c0 : tensor<3x5xi32>
|
|
return %0 : index
|
|
}
|
|
|
|
// -----
|
|
|
|
// CHECK-LABEL: @dim_any_static
|
|
// CHECK: %[[op:.+]] = tensor.dim
|
|
// CHECK: %[[ret:.+]] = test.reflect_bounds {smax = 5 : index, smin = 3 : index, umax = 5 : index, umin = 3 : index} %[[op]]
|
|
// CHECK: return %[[ret]]
|
|
func.func @dim_any_static(%t: tensor<3x5xi32>, %x: index) -> index {
|
|
%0 = tensor.dim %t, %x : tensor<3x5xi32>
|
|
%1 = test.reflect_bounds %0 : index
|
|
return %1 : index
|
|
}
|
|
|
|
// -----
|
|
|
|
// CHECK-LABEL: @dim_dynamic
|
|
// CHECK: %[[op:.+]] = tensor.dim
|
|
// CHECK: %[[ret:.+]] = test.reflect_bounds {smax = 9223372036854775807 : index, smin = 0 : index, umax = 9223372036854775807 : index, umin = 0 : index} %[[op]]
|
|
// CHECK: return %[[ret]]
|
|
func.func @dim_dynamic(%t: tensor<?x5xi32>) -> index {
|
|
%c0 = arith.constant 0 : index
|
|
%0 = tensor.dim %t, %c0 : tensor<?x5xi32>
|
|
%1 = test.reflect_bounds %0 : index
|
|
return %1 : index
|
|
}
|
|
|
|
// -----
|
|
|
|
// CHECK-LABEL: @dim_any_dynamic
|
|
// CHECK: %[[op:.+]] = tensor.dim
|
|
// CHECK: %[[ret:.+]] = test.reflect_bounds {smax = 9223372036854775807 : index, smin = 0 : index, umax = 9223372036854775807 : index, umin = 0 : index} %[[op]]
|
|
// CHECK: return %[[ret]]
|
|
func.func @dim_any_dynamic(%t: tensor<?x5xi32>, %x: index) -> index {
|
|
%0 = tensor.dim %t, %x : tensor<?x5xi32>
|
|
%1 = test.reflect_bounds %0 : index
|
|
return %1 : index
|
|
}
|
|
|
|
// -----
|
|
|
|
// CHECK-LABEL: @dim_some_omitting_dynamic
|
|
// CHECK: %[[op:.+]] = tensor.dim
|
|
// CHECK: %[[ret:.+]] = test.reflect_bounds {smax = 5 : index, smin = 3 : index, umax = 5 : index, umin = 3 : index} %[[op]]
|
|
// CHECK: return %[[ret]]
|
|
func.func @dim_some_omitting_dynamic(%t: tensor<?x3x5xi32>, %x: index) -> index {
|
|
%c1 = arith.constant 1 : index
|
|
%0 = arith.maxsi %x, %c1 : index
|
|
%1 = tensor.dim %t, %0 : tensor<?x3x5xi32>
|
|
%2 = test.reflect_bounds %1 : index
|
|
return %2 : index
|
|
}
|
|
|
|
// -----
|
|
|
|
// CHECK-LABEL: @dim_unranked
|
|
// CHECK: %[[op:.+]] = tensor.dim
|
|
// CHECK: %[[ret:.+]] = test.reflect_bounds {smax = 9223372036854775807 : index, smin = 0 : index, umax = 9223372036854775807 : index, umin = 0 : index} %[[op]]
|
|
// CHECK: return %[[ret]]
|
|
func.func @dim_unranked(%t: tensor<*xi32>) -> index {
|
|
%c0 = arith.constant 0 : index
|
|
%0 = tensor.dim %t, %c0 : tensor<*xi32>
|
|
%1 = test.reflect_bounds %0 : index
|
|
return %1 : index
|
|
}
|