[mlir] NFC: Expose tiled_loop->scf pattern.

Differential Revision: https://reviews.llvm.org/D102921
This commit is contained in:
Alexander Belyaev 2021-05-21 17:00:35 +02:00
parent cc5f6ae4b4
commit 335fa18028
2 changed files with 8 additions and 1 deletions

View File

@ -81,6 +81,9 @@ void populateFoldUnitExtentDimsPatterns(RewritePatternSet &patterns);
/// Patterns that are used to inline constant operands into linalg generic ops.
void populateInlineConstantOperandsPatterns(RewritePatternSet &patterns);
/// Pattern to convert TiledLoopOp to SCF loops.
void populateTiledLoopToSCFPattern(RewritePatternSet &patterns);
/// Options that control fusion of elementwise operations.
struct LinalgElementwiseFusionOptions {
/// Enable fusion of reshapes into the shape with elementwise operations. By

View File

@ -597,12 +597,16 @@ struct LowerTiledLoopsToSCF
void runOnFunction() override {
MLIRContext *context = &getContext();
RewritePatternSet patterns(context);
patterns.add<TiledLoopToSCFPattern>(context);
populateTiledLoopToSCFPattern(patterns);
(void)applyPatternsAndFoldGreedily(getFunction(), std::move(patterns));
}
};
} // namespace
void mlir::linalg::populateTiledLoopToSCFPattern(RewritePatternSet &patterns) {
patterns.add<TiledLoopToSCFPattern>(patterns.getContext());
}
std::unique_ptr<OperationPass<FuncOp>>
mlir::createConvertLinalgTiledLoopsToSCFPass() {
return std::make_unique<LowerTiledLoopsToSCF>();