1
- // ===- SimplifyExtractStridedMetadata .cpp - Simplify this operation -------===//
1
+ // ===- ExpandStridedMetadata .cpp - Simplify this operation -------===//
2
2
//
3
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
4
// See https://llvm.org/LICENSE.txt for license information.
5
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
6
//
7
7
// ===----------------------------------------------------------------------===//
8
8
//
9
- // / This pass simplifies extract_strided_metadata(other_op(memref) to
10
- // / extract_strided_metadata(memref) when it is possible to express the effect
11
- // of other_op using affine apply on the results of
12
- // extract_strided_metadata(memref).
9
+ // / The pass expands memref operations that modify the metadata of a memref
10
+ // / (sizes, offset, strides) into a sequence of easier to analyze constructs.
11
+ // / In particular, this pass transforms operations into explicit sequence of
12
+ // / operations that model the effect of this operation on the different
13
+ // / metadata. This pass uses affine constructs to materialize these effects.
13
14
// ===----------------------------------------------------------------------===//
14
15
15
16
#include " mlir/Dialect/Affine/IR/AffineOps.h"
23
24
24
25
namespace mlir {
25
26
namespace memref {
26
- #define GEN_PASS_DEF_SIMPLIFYEXTRACTSTRIDEDMETADATA
27
+ #define GEN_PASS_DEF_EXPANDSTRIDEDMETADATA
27
28
#include " mlir/Dialect/MemRef/Transforms/Passes.h.inc"
28
29
} // namespace memref
29
30
} // namespace mlir
@@ -736,7 +737,7 @@ class ExtractStridedMetadataOpExtractStridedMetadataFolder
736
737
};
737
738
} // namespace
738
739
739
- void memref::populateSimplifyExtractStridedMetadataOpPatterns (
740
+ void memref::populateExpandStridedMetadataPatterns (
740
741
RewritePatternSet &patterns) {
741
742
patterns.add <SubviewFolder,
742
743
ReshapeFolder<memref::ExpandShapeOp, getExpandedSizes,
@@ -757,21 +758,21 @@ void memref::populateSimplifyExtractStridedMetadataOpPatterns(
757
758
758
759
namespace {
759
760
760
- struct SimplifyExtractStridedMetadataPass final
761
- : public memref::impl::SimplifyExtractStridedMetadataBase <
762
- SimplifyExtractStridedMetadataPass > {
761
+ struct ExpandStridedMetadataPass final
762
+ : public memref::impl::ExpandStridedMetadataBase <
763
+ ExpandStridedMetadataPass > {
763
764
void runOnOperation () override ;
764
765
};
765
766
766
767
} // namespace
767
768
768
- void SimplifyExtractStridedMetadataPass ::runOnOperation () {
769
+ void ExpandStridedMetadataPass ::runOnOperation () {
769
770
RewritePatternSet patterns (&getContext ());
770
- memref::populateSimplifyExtractStridedMetadataOpPatterns (patterns);
771
+ memref::populateExpandStridedMetadataPatterns (patterns);
771
772
(void )applyPatternsAndFoldGreedily (getOperation ()->getRegions (),
772
773
std::move (patterns));
773
774
}
774
775
775
- std::unique_ptr<Pass> memref::createSimplifyExtractStridedMetadataPass () {
776
- return std::make_unique<SimplifyExtractStridedMetadataPass >();
776
+ std::unique_ptr<Pass> memref::createExpandStridedMetadataPass () {
777
+ return std::make_unique<ExpandStridedMetadataPass >();
777
778
}
0 commit comments