diff options
author | Lei Zhang <antiagainst@google.com> | 2022-02-16 19:26:47 +0300 |
---|---|---|
committer | Lei Zhang <antiagainst@google.com> | 2022-02-16 21:43:57 +0300 |
commit | e027c00821dda48d06cf73c6c16176fcb7b8adcb (patch) | |
tree | 16271ec01aaa55ec5b18f512d2bd515b10e1f9df /utils | |
parent | 6f1ce046fdd02458fe2e3824b865ba4bdf129d67 (diff) |
[mlir][tensor] Add a pattern to split tensor.pad ops
This commit adds a pattern to wrap a tensor.pad op with
an scf.if op to separate the cases where we don't need padding
(all pad sizes are actually zeros) and where we indeed need
padding.
This pattern is meant to handle padding inside tiled loops.
Under such cases the padding sizes typically depend on the
loop induction variables. Splitting them would allow treating
perfect tiles and edge tiles separately.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D117018
Diffstat (limited to 'utils')
-rw-r--r-- | utils/bazel/llvm-project-overlay/mlir/BUILD.bazel | 3 | ||||
-rw-r--r-- | utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel | 15 |
2 files changed, 18 insertions, 0 deletions
diff --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel index da029a721b3a..511c22132ad6 100644 --- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel @@ -4645,6 +4645,7 @@ cc_library( hdrs = [ "include/mlir/Dialect/Tensor/Transforms/BufferizableOpInterfaceImpl.h", "include/mlir/Dialect/Tensor/Transforms/Passes.h", + "include/mlir/Dialect/Tensor/Transforms/Transforms.h", ], includes = ["include"], deps = [ @@ -4652,6 +4653,7 @@ cc_library( ":Async", ":BufferizationDialect", ":BufferizationTransforms", + ":DialectUtils", ":IR", ":MemRefDialect", ":ParallelLoopMapperAttrGen", @@ -5985,6 +5987,7 @@ cc_binary( "//mlir/test:TestShapeDialect", "//mlir/test:TestStandardOps", "//mlir/test:TestStandardToLLVM", + "//mlir/test:TestTensor", "//mlir/test:TestTosaDialect", "//mlir/test:TestTransforms", "//mlir/test:TestTypeDialect", diff --git a/utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel index 505508ba8976..86aaabedd14f 100644 --- a/utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel @@ -511,6 +511,21 @@ cc_library( ) cc_library( + name = "TestTensor", + srcs = glob(["lib/Dialect/Tensor/*.cpp"]), + defines = ["MLIR_CUDA_CONVERSIONS_ENABLED"], + includes = ["lib/Dialect/Test"], + deps = [ + "//mlir:ArithmeticDialect", + "//mlir:Pass", + "//mlir:SCFDialect", + "//mlir:TensorDialect", + "//mlir:TensorTransforms", + "//mlir:Transforms", + ], +) + +cc_library( name = "TestVector", srcs = glob(["lib/Dialect/Vector/*.cpp"]), defines = ["MLIR_CUDA_CONVERSIONS_ENABLED"], |