Skip to content

Commit d64c0e1

Browse files
committed
Merge select_riscv_lowering_strategy*.mlir test
Signed-off-by: Bruce Lai <[email protected]>
1 parent a2f118d commit d64c0e1

File tree

4 files changed

+34
-34
lines changed

4 files changed

+34
-34
lines changed

compiler/src/iree/compiler/Codegen/LLVMCPU/test/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ iree_lit_test_suite(
5454
"select_aarch64_sve_lowering_strategy_peeling.mlir",
5555
"select_lowering_strategy_without_distribution.mlir",
5656
"select_riscv_lowering_strategy.mlir",
57-
"select_riscv_lowering_strategy_with_aggressive_distribution.mlir",
5857
"select_x86_64_lowering_strategy.mlir",
5958
"split_reduction.mlir",
6059
"synchronize_symbol_visibility.mlir",

compiler/src/iree/compiler/Codegen/LLVMCPU/test/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ iree_lit_test_suite(
4949
"select_aarch64_sve_lowering_strategy_peeling.mlir"
5050
"select_lowering_strategy_without_distribution.mlir"
5151
"select_riscv_lowering_strategy.mlir"
52-
"select_riscv_lowering_strategy_with_aggressive_distribution.mlir"
5352
"select_x86_64_lowering_strategy.mlir"
5453
"split_reduction.mlir"
5554
"synchronize_symbol_visibility.mlir"

compiler/src/iree/compiler/Codegen/LLVMCPU/test/select_riscv_lowering_strategy.mlir

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: iree-opt --pass-pipeline='builtin.module(iree-llvmcpu-select-lowering-strategy)' --split-input-file %s | FileCheck %s
2+
// RUN: iree-opt --iree-llvmcpu-riscv-aggressive-distribution=true --pass-pipeline='builtin.module(iree-llvmcpu-select-lowering-strategy)' --split-input-file %s | FileCheck %s -check-prefixes=CHECK-AGGRESSIVE
23

34
#pipeline_layout = #hal.pipeline.layout<bindings = [
45
#hal.pipeline.binding<storage_buffer>,
@@ -155,3 +156,36 @@ func.func @thin_depthwise_conv_static() attributes {hal.executable.target = #exe
155156
// CHECK-SAME: translation_info = #[[TRANSLATION]]
156157
// CHECK: linalg.depthwise_conv_2d_nhwc_hwc
157158
// CHECK-SAME: lowering_config = #[[CONFIG]]
159+
160+
// -----
161+
162+
#pipeline_layout = #hal.pipeline.layout<bindings = [
163+
#hal.pipeline.binding<storage_buffer>,
164+
#hal.pipeline.binding<storage_buffer>,
165+
#hal.pipeline.binding<storage_buffer>
166+
]>
167+
168+
#executable_target_embedded_elf_riscv_64_ = #hal.executable.target<"llvm-cpu", "embedded-elf-riscv_64", {cpu_features = "+m,+a,+f,+d,+zvl1024b,+v", data_layout = "e-m:e-p:64:64-i64:64-i256:256-n32:64-S256", native_vector_size = 256 : index, target_triple = "riscv64-unknown-unknown-eabi-elf"}>
169+
builtin.module {
170+
func.func @matmul_riscv_vl1024() attributes {hal.executable.target = #executable_target_embedded_elf_riscv_64_} {
171+
%cst = arith.constant 0.0 : f32
172+
%0 = hal.interface.binding.subspan layout(#pipeline_layout) binding(0) : !flow.dispatch.tensor<readonly:tensor<384x512xf32>>
173+
%1 = hal.interface.binding.subspan layout(#pipeline_layout) binding(1) : !flow.dispatch.tensor<readonly:tensor<512x256xf32>>
174+
%2 = hal.interface.binding.subspan layout(#pipeline_layout) binding(2) : !flow.dispatch.tensor<writeonly:tensor<384x256xf32>>
175+
%lhs = flow.dispatch.tensor.load %0, offsets = [0, 0], sizes = [384, 512], strides = [1, 1] : !flow.dispatch.tensor<readonly:tensor<384x512xf32>> -> tensor<384x512xf32>
176+
%rhs = flow.dispatch.tensor.load %1, offsets = [0, 0], sizes = [512, 256], strides = [1, 1] : !flow.dispatch.tensor<readonly:tensor<512x256xf32>> -> tensor<512x256xf32>
177+
%init = tensor.empty() : tensor<384x256xf32>
178+
%fill = linalg.fill ins(%cst : f32) outs(%init : tensor<384x256xf32>) -> tensor<384x256xf32>
179+
%res = linalg.matmul ins(%lhs, %rhs : tensor<384x512xf32>, tensor<512x256xf32>) outs(%fill : tensor<384x256xf32>) -> tensor<384x256xf32>
180+
flow.dispatch.tensor.store %res, %2, offsets = [0, 0], sizes = [384, 256], strides = [1, 1] : tensor<384x256xf32> -> !flow.dispatch.tensor<writeonly:tensor<384x256xf32>>
181+
return
182+
}
183+
}
184+
185+
// CHECK-AGGRESSIVE-DAG: #[[CONFIG:.+]] = #iree_codegen.lowering_config<tile_sizes = {{\[}}[32, 256], [7, 128], [0, 0], [0, 0]]>
186+
// CHECK-AGGRESSIVE-DAG: #[[CONFIG2:.+]] = #iree_codegen.lowering_config<tile_sizes = {{\[}}[32, 256, 0], [32, 256, 0], [0, 0, 0], [7, 128, 0], [0, 0, 1], [0, 0, 0]]>
187+
// CHECK-AGGRESSIVE-DAG: #[[TRANSLATION:.+]] = #iree_codegen.translation_info<CPUDoubleTilingExpert, {{\{}}enable_loop_peeling}>
188+
// CHECK-AGGRESSIVE: func.func @matmul_riscv_vl1024()
189+
// CHECK-AGGRESSIVE-SAME: translation_info = #[[TRANSLATION]]
190+
// CHECK-AGGRESSIVE: linalg.matmul
191+
// CHECK-AGGRESSIVE-SAME: lowering_config = #[[CONFIG2]]

compiler/src/iree/compiler/Codegen/LLVMCPU/test/select_riscv_lowering_strategy_with_aggressive_distribution.mlir

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)