forked from OSchip/llvm-project
Adds a flag to optionally disable tosa decompositions
Reviewed By: rsuderman Differential Revision: https://reviews.llvm.org/D120338
This commit is contained in:
parent
19d8642633
commit
fd2550d80c
|
@ -24,8 +24,10 @@ std::unique_ptr<Pass> createTosaToLinalgNamed();
|
|||
|
||||
/// Populates passes to convert from TOSA to Linalg on buffers. At the end of
|
||||
/// the pass, the function will only contain linalg ops or standard ops if the
|
||||
/// pipeline succeeds.
|
||||
void addTosaToLinalgPasses(OpPassManager &pm);
|
||||
/// pipeline succeeds. The option to disable decompositions is available for
|
||||
/// benchmarking performance improvements from the canonicalizations.
|
||||
void addTosaToLinalgPasses(OpPassManager &pm,
|
||||
bool disableTosaDecompositions = false);
|
||||
|
||||
/// Populates conversion passes from TOSA dialect to Linalg dialect.
|
||||
void populateTosaToLinalgConversionPatterns(RewritePatternSet *patterns);
|
||||
|
|
|
@ -67,9 +67,11 @@ std::unique_ptr<Pass> mlir::tosa::createTosaToLinalg() {
|
|||
return std::make_unique<TosaToLinalg>();
|
||||
}
|
||||
|
||||
void mlir::tosa::addTosaToLinalgPasses(OpPassManager &pm) {
|
||||
void mlir::tosa::addTosaToLinalgPasses(OpPassManager &pm,
|
||||
bool disableTosaDecompositions) {
|
||||
// Optional decompositions are designed to benefit linalg.
|
||||
pm.addNestedPass<FuncOp>(mlir::tosa::createTosaOptionalDecompositions());
|
||||
if (!disableTosaDecompositions)
|
||||
pm.addNestedPass<FuncOp>(mlir::tosa::createTosaOptionalDecompositions());
|
||||
pm.addNestedPass<FuncOp>(mlir::createCanonicalizerPass());
|
||||
|
||||
pm.addNestedPass<FuncOp>(tosa::createTosaMakeBroadcastablePass());
|
||||
|
|
Loading…
Reference in New Issue