//===- mlir-reduce.cpp - The MLIR reducer ---------------------------------===// // // 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 implements the general framework of the MLIR reducer tool. It // parses the command line arguments, parses the initial MLIR test case and sets // up the testing environment. It outputs the most reduced test case variant // after executing the reduction passes. // //===----------------------------------------------------------------------===// #include "mlir/Tools/mlir-reduce/MlirReduceMain.h" #include "mlir/IR/PatternMatch.h" #include "mlir/Parser/Parser.h" #include "mlir/Pass/Pass.h" #include "mlir/Pass/PassManager.h" #include "mlir/Reducer/Passes.h" #include "mlir/Rewrite/FrozenRewritePatternSet.h" #include "mlir/Support/FileUtilities.h" #include "mlir/Tools/ParseUtilities.h" #include "llvm/Support/InitLLVM.h" #include "llvm/Support/SourceMgr.h" #include "llvm/Support/ToolOutputFile.h" usingnamespacemlir; // Parse and verify the input MLIR file. Returns null on error. OwningOpRef<Operation *> loadModule(MLIRContext &context, StringRef inputFilename, bool insertImplictModule) { … } LogicalResult mlir::mlirReduceMain(int argc, char **argv, MLIRContext &context) { … }