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
130 lines
5.0 KiB
MLIR
130 lines
5.0 KiB
MLIR
// RUN: mlir-opt %s -convert-arith-to-arm-sme -split-input-file -allow-unregistered-dialect | FileCheck %s
|
|
|
|
// =============================================================================
|
|
// arith.constant dense<0> to arm_sme.zero
|
|
// =============================================================================
|
|
|
|
// -----
|
|
|
|
// CHECK-LABEL: @arith_constant_dense_2d_zero_i8
|
|
// CHECK: %[[ZERO:.*]] = arm_sme.zero : vector<[16]x[16]xi8>
|
|
func.func @arith_constant_dense_2d_zero_i8() {
|
|
%zero = arith.constant dense<0> : vector<[16]x[16]xi8>
|
|
"prevent.dce"(%zero) : (vector<[16]x[16]xi8>) -> ()
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
// CHECK-LABEL: @arith_constant_dense_2d_zero_i16
|
|
// CHECK: %[[ZERO:.*]] = arm_sme.zero : vector<[8]x[8]xi16>
|
|
func.func @arith_constant_dense_2d_zero_i16() {
|
|
%zero = arith.constant dense<0> : vector<[8]x[8]xi16>
|
|
"prevent.dce"(%zero) : (vector<[8]x[8]xi16>) -> ()
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
// CHECK-LABEL: @arith_constant_dense_2d_zero_i32
|
|
// CHECK: %[[ZERO:.*]] = arm_sme.zero : vector<[4]x[4]xi32>
|
|
func.func @arith_constant_dense_2d_zero_i32() {
|
|
%zero = arith.constant dense<0> : vector<[4]x[4]xi32>
|
|
"prevent.dce"(%zero) : (vector<[4]x[4]xi32>) -> ()
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
// CHECK-LABEL: @arith_constant_dense_2d_zero_i64
|
|
// CHECK: %[[ZERO:.*]] = arm_sme.zero : vector<[2]x[2]xi64>
|
|
func.func @arith_constant_dense_2d_zero_i64() {
|
|
%zero = arith.constant dense<0> : vector<[2]x[2]xi64>
|
|
"prevent.dce"(%zero) : (vector<[2]x[2]xi64>) -> ()
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
// CHECK-LABEL: @arith_constant_dense_2d_zero_f16
|
|
// CHECK: %[[ZERO:.*]] = arm_sme.zero : vector<[8]x[8]xf16>
|
|
func.func @arith_constant_dense_2d_zero_f16() {
|
|
%zero = arith.constant dense<0.0> : vector<[8]x[8]xf16>
|
|
"prevent.dce"(%zero) : (vector<[8]x[8]xf16>) -> ()
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
// CHECK-LABEL: @arith_constant_dense_2d_zero_bf16
|
|
// CHECK: %[[ZERO:.*]] = arm_sme.zero : vector<[8]x[8]xbf16>
|
|
func.func @arith_constant_dense_2d_zero_bf16() {
|
|
%zero = arith.constant dense<0.0> : vector<[8]x[8]xbf16>
|
|
"prevent.dce"(%zero) : (vector<[8]x[8]xbf16>) -> ()
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
// CHECK-LABEL: @arith_constant_dense_2d_zero_f32
|
|
// CHECK: %[[ZERO:.*]] = arm_sme.zero : vector<[4]x[4]xf32>
|
|
func.func @arith_constant_dense_2d_zero_f32() {
|
|
%zero = arith.constant dense<0.0> : vector<[4]x[4]xf32>
|
|
"prevent.dce"(%zero) : (vector<[4]x[4]xf32>) -> ()
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
// CHECK-LABEL: @arith_constant_dense_2d_zero_f64
|
|
// CHECK: %[[ZERO:.*]] = arm_sme.zero : vector<[2]x[2]xf64>
|
|
func.func @arith_constant_dense_2d_zero_f64() {
|
|
%zero = arith.constant dense<0.0> : vector<[2]x[2]xf64>
|
|
"prevent.dce"(%zero) : (vector<[2]x[2]xf64>) -> ()
|
|
return
|
|
}
|
|
|
|
// =============================================================================
|
|
// Non-zero arith.constant dense to SME
|
|
// =============================================================================
|
|
|
|
// -----
|
|
|
|
// CHECK-LABEL: func.func @arith_constant_dense_2d_nonzero_i8() {
|
|
// CHECK-DAG: %[[C2_SPLAT:.*]] = arith.constant dense<2> : vector<[16]xi8>
|
|
// CHECK-DAG: %[[C1:.*]] = arith.constant 1 : index
|
|
// CHECK-DAG: %[[C16:.*]] = arith.constant 16 : index
|
|
// CHECK-DAG: %[[C0:.*]] = arith.constant 0 : index
|
|
// CHECK: %[[INIT_TILE:.*]] = arm_sme.get_tile : vector<[16]x[16]xi8>
|
|
// CHECK: %[[VSCALE:.*]] = vector.vscale
|
|
// CHECK: %[[NUM_TILE_SLICES:.*]] = arith.muli %[[VSCALE]], %[[C16]] : index
|
|
// CHECK: %[[TILE:.*]] = scf.for %[[TILE_SLICE_INDEX:.*]] = %[[C0]] to %[[NUM_TILE_SLICES]] step %[[C1]] iter_args(%[[CURRENT_TILE:.*]] = %[[INIT_TILE]]) -> (vector<[16]x[16]xi8>) {
|
|
// CHECK: %[[TILE_UPDATE:.*]] = arm_sme.insert_tile_slice %[[C2_SPLAT]], %[[CURRENT_TILE]][%[[TILE_SLICE_INDEX]]] : vector<[16]xi8> into vector<[16]x[16]xi8>
|
|
// CHECK: scf.yield %[[TILE_UPDATE]] : vector<[16]x[16]xi8>
|
|
// CHECK: "prevent.dce"(%[[TILE]]) : (vector<[16]x[16]xi8>) -> ()
|
|
func.func @arith_constant_dense_2d_nonzero_i8() {
|
|
%two = arith.constant dense<2> : vector<[16]x[16]xi8>
|
|
"prevent.dce"(%two) : (vector<[16]x[16]xi8>) -> ()
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
// CHECK-LABEL: func.func @arith_constant_dense_2d_nonzero_f64() {
|
|
// CHECK-DAG: %[[C2_SPLAT:.*]] = arith.constant dense<2.000000e+00> : vector<[2]xf64>
|
|
// CHECK-DAG: %[[C1:.*]] = arith.constant 1 : index
|
|
// CHECK-DAG: %[[C2:.*]] = arith.constant 2 : index
|
|
// CHECK-DAG: %[[C0:.*]] = arith.constant 0 : index
|
|
// CHECK: %[[INIT_TILE:.*]] = arm_sme.get_tile : vector<[2]x[2]xf64>
|
|
// CHECK: %[[VSCALE:.*]] = vector.vscale
|
|
// CHECK: %[[NUM_TILE_SLICES:.*]] = arith.muli %[[VSCALE]], %[[C2]] : index
|
|
// CHECK: %[[TILE:.*]] = scf.for %[[TILE_SLICE_INDEX:.*]] = %[[C0]] to %[[NUM_TILE_SLICES]] step %[[C1]] iter_args(%[[CURRENT_TILE:.*]] = %[[INIT_TILE]]) -> (vector<[2]x[2]xf64>) {
|
|
// CHECK: %[[TILE_UPDATE:.*]] = arm_sme.insert_tile_slice %[[C2_SPLAT]], %[[CURRENT_TILE]][%[[TILE_SLICE_INDEX]]] : vector<[2]xf64> into vector<[2]x[2]xf64>
|
|
// CHECK: scf.yield %[[TILE_UPDATE]] : vector<[2]x[2]xf64>
|
|
// CHECK: "prevent.dce"(%[[TILE]]) : (vector<[2]x[2]xf64>) -> ()
|
|
func.func @arith_constant_dense_2d_nonzero_f64() {
|
|
%two = arith.constant dense<2.0> : vector<[2]x[2]xf64>
|
|
"prevent.dce"(%two) : (vector<[2]x[2]xf64>) -> ()
|
|
return
|
|
}
|