mirror of https://github.com/llvm/torch-mlir
add no decompose option
parent
9f7264a7a4
commit
5243638e33
|
@ -32,6 +32,11 @@ struct TorchLoweringPipelineOptions
|
|||
// If this option is false, only do the bare minimum for correctness.
|
||||
Option<bool> optimize{*this, "optimize", llvm::cl::desc("Do optimizations."),
|
||||
llvm::cl::init(true)};
|
||||
|
||||
// If this option is false, decompose complex operations.
|
||||
// If this option is true, skip decomposition of complex operations.
|
||||
Option<bool> nodecompose{*this, "nodecompose", llvm::cl::desc("No decomposition."),
|
||||
llvm::cl::init(false)};
|
||||
};
|
||||
|
||||
/// Creates a pipeline that lowers the object graph IR that is produced by
|
||||
|
|
|
@ -154,6 +154,8 @@ void mlir::torch::Torch::createTorchFunctionToTorchBackendPipeline(
|
|||
// only-used-in-training operations on `torch.global_slot`'s.
|
||||
pm.addNestedPass<func::FuncOp>(createCanonicalizerPass());
|
||||
}
|
||||
|
||||
if (!options.nodecompose)
|
||||
pm.addNestedPass<func::FuncOp>(Torch::createDecomposeComplexOpsPass());
|
||||
|
||||
// TODO: VerifyTorchBackendContractPass.
|
||||
|
|
Loading…
Reference in New Issue