forked from iree-org/iree
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move more pass from Flow stage to GlobalOptimization stage. (iree-org…
…#14707) - Move four more passes to GlobalOptimization stage. - ConvertElementwiseToLinalgPass - GeneralizeLinalgNamedOpsPass - FuseDequantizationMatmulPass - FoldUnitExtentDimsPass - Move Flow transformation_pipeline.mlir test to GlobalOptimization/test. It is mainly for testing ConvertElementwiseToLinalg pass which is also tested upstream. We probably can remove it as a follow-up.
- Loading branch information
Showing
12 changed files
with
94 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
compiler/src/iree/compiler/Dialect/Flow/Transforms/test/pipeline_tests.mlir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 0 additions & 31 deletions
31
compiler/src/iree/compiler/Dialect/Flow/Transforms/test/transformation_pipeline.mlir
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
compiler/src/iree/compiler/GlobalOptimization/test/BUILD.bazel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright 2023 The IREE Authors | ||
# | ||
# Licensed under the Apache License v2.0 with LLVM Exceptions. | ||
# See https://llvm.org/LICENSE.txt for license information. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
load("//build_tools/bazel:iree_lit_test.bzl", "iree_lit_test_suite") | ||
load("//build_tools/bazel:enforce_glob.bzl", "enforce_glob") | ||
|
||
package( | ||
features = ["layering_check"], | ||
licenses = ["notice"], # Apache 2.0 | ||
) | ||
|
||
iree_lit_test_suite( | ||
name = "lit", | ||
srcs = enforce_glob( | ||
[ | ||
"transformation_pipeline.mlir", | ||
], | ||
include = ["*.mlir"], | ||
), | ||
cfg = "//compiler:lit.cfg.py", | ||
tools = [ | ||
"//tools:iree-opt", | ||
"@llvm-project//llvm:FileCheck", | ||
], | ||
) |
23 changes: 23 additions & 0 deletions
23
compiler/src/iree/compiler/GlobalOptimization/test/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
################################################################################ | ||
# Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from # | ||
# compiler/src/iree/compiler/GlobalOptimization/test/BUILD.bazel # | ||
# # | ||
# Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary # | ||
# CMake-only content. # | ||
# # | ||
# To disable autogeneration for this file entirely, delete this header. # | ||
################################################################################ | ||
|
||
iree_add_all_subdirs() | ||
|
||
iree_lit_test_suite( | ||
NAME | ||
lit | ||
SRCS | ||
"transformation_pipeline.mlir" | ||
TOOLS | ||
FileCheck | ||
iree-opt | ||
) | ||
|
||
### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ### |
24 changes: 24 additions & 0 deletions
24
compiler/src/iree/compiler/GlobalOptimization/test/transformation_pipeline.mlir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// RUN: iree-opt --split-input-file --iree-global-optimization-transformation-pipeline %s | FileCheck %s | ||
|
||
// CHECK-LABEL: @empty | ||
func.func @empty() { | ||
// CHECK-NEXT: return | ||
return | ||
} | ||
|
||
// ----- | ||
|
||
func.func @elementwiseOps(%arg0 : tensor<4xf32>) -> tensor<4xf32> { | ||
%0 = arith.addf %arg0, %arg0 : tensor<4xf32> | ||
%1 = arith.subf %0, %arg0 : tensor<4xf32> | ||
%2 = arith.mulf %1, %arg0 : tensor<4xf32> | ||
return %2 : tensor<4xf32> | ||
} | ||
|
||
// CHECK-LABEL: func.func @elementwiseOps(%arg0: tensor<4xf32>) -> tensor<4xf32> { | ||
// CHECK: %{{.+}} = linalg.generic | ||
// CHECK: %{{.+}} = arith.addf %{{.+}}, %{{.+}} : f32 | ||
// CHECK: %{{.+}} = linalg.generic | ||
// CHECK: %{{.+}} = arith.subf %{{.+}}, %{{.+}} : f32 | ||
// CHECK: %{{.+}} = linalg.generic | ||
// CHECK: %{{.+}} = arith.mulf %{{.+}}, %{{.+}} : f32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters