//===- OptReductionPass.cpp - Optimization Reduction Pass Wrapper ---------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file defines the Opt Reduction Pass Wrapper. It creates a MLIR pass to // run any optimization pass within it and only replaces the output module with // the transformed version if it is smaller and interesting. // //===----------------------------------------------------------------------===// #include "mlir/Pass/PassManager.h" #include "mlir/Pass/PassRegistry.h" #include "mlir/Reducer/Passes.h" #include "mlir/Reducer/Tester.h" #include "llvm/Support/Debug.h" namespace mlir { #define GEN_PASS_DEF_OPTREDUCTION #include "mlir/Reducer/Passes.h.inc" } // namespace mlir #define DEBUG_TYPE … usingnamespacemlir; namespace { class OptReductionPass : public impl::OptReductionBase<OptReductionPass> { … }; } // namespace /// Runs the pass instance in the pass pipeline. void OptReductionPass::runOnOperation() { … } std::unique_ptr<Pass> mlir::createOptReductionPass() { … }