MLIR
20.0.0git
|
#include "mlir/Tools/mlir-opt/MlirOptMain.h"
#include "mlir/Bytecode/BytecodeWriter.h"
#include "mlir/Debug/CLOptionsSetup.h"
#include "mlir/Debug/Counter.h"
#include "mlir/Debug/DebuggerExecutionContextHook.h"
#include "mlir/Debug/ExecutionContext.h"
#include "mlir/Debug/Observers/ActionLogging.h"
#include "mlir/Dialect/IRDL/IR/IRDL.h"
#include "mlir/Dialect/IRDL/IRDLLoading.h"
#include "mlir/IR/AsmState.h"
#include "mlir/IR/Attributes.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/Diagnostics.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/Location.h"
#include "mlir/IR/MLIRContext.h"
#include "mlir/Parser/Parser.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Pass/PassManager.h"
#include "mlir/Pass/PassRegistry.h"
#include "mlir/Support/FileUtilities.h"
#include "mlir/Support/Timing.h"
#include "mlir/Support/ToolUtilities.h"
#include "mlir/Tools/ParseUtilities.h"
#include "mlir/Tools/Plugins/DialectPlugin.h"
#include "mlir/Tools/Plugins/PassPlugin.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileUtilities.h"
#include "llvm/Support/InitLLVM.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/Regex.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/StringSaver.h"
#include "llvm/Support/ThreadPool.h"
#include "llvm/Support/ToolOutputFile.h"
Go to the source code of this file.
Functions | |
LogicalResult | loadIRDLDialects (StringRef irdlFile, MLIRContext &ctx) |
static LogicalResult | doVerifyRoundTrip (Operation *op, const MlirOptMainConfig &config, bool useBytecode) |
static LogicalResult | doVerifyRoundTrip (Operation *op, const MlirOptMainConfig &config) |
static LogicalResult | performActions (raw_ostream &os, const std::shared_ptr< llvm::SourceMgr > &sourceMgr, MLIRContext *context, const MlirOptMainConfig &config) |
Perform the actions on the input file indicated by the command line flags within the specified context. More... | |
static LogicalResult | processBuffer (raw_ostream &os, std::unique_ptr< MemoryBuffer > ownedBuffer, const MlirOptMainConfig &config, DialectRegistry ®istry, llvm::ThreadPoolInterface *threadPool) |
Parses the memory buffer. More... | |
static LogicalResult | printRegisteredDialects (DialectRegistry ®istry) |
static LogicalResult | printRegisteredPassesAndReturn () |
Variables | |
ManagedStatic< MlirOptMainConfigCLOptions > | clOptionsConfig |
|
static |
Definition at line 353 of file MlirOptMain.cpp.
References doVerifyRoundTrip().
|
static |
Definition at line 287 of file MlirOptMain.cpp.
References mlir::MLIRContext::allowsUnregisteredDialects(), mlir::MLIRContext::allowUnregisteredDialects(), mlir::MLIRContext::appendDialectRegistry(), mlir::Operation::emitOpError(), mlir::OwningOpRef< OpTy >::get(), mlir::Operation::getContext(), mlir::MLIRContext::getDialectRegistry(), mlir::MlirOptMainConfig::getIrdlFile(), loadIRDLDialects(), mlir::Operation::print(), mlir::MlirOptMainConfig::shouldVerifyOnParsing(), and mlir::writeBytecodeToFile().
Referenced by doVerifyRoundTrip(), and performActions().
LogicalResult loadIRDLDialects | ( | StringRef | irdlFile, |
MLIRContext & | ctx | ||
) |
Definition at line 256 of file MlirOptMain.cpp.
References mlir::MLIRContext::appendDialectRegistry(), mlir::emitError(), mlir::OwningOpRef< OpTy >::get(), mlir::get(), mlir::DialectRegistry::insert(), mlir::irdl::loadDialects(), and mlir::openInputFile().
Referenced by doVerifyRoundTrip().
|
static |
Perform the actions on the input file indicated by the command line flags within the specified context.
This typically parses the main source file, runs zero or more optimization passes, then prints the output.
Definition at line 367 of file MlirOptMain.cpp.
References mlir::PassReproducerOptions::apply(), mlir::applyDefaultTimingManagerCLOptions(), mlir::applyPassManagerCLOptions(), mlir::PassReproducerOptions::attachResourceParser(), mlir::MlirOptMainConfig::bytecodeVersionToEmit(), mlir::MLIRContext::disableMultithreading(), doVerifyRoundTrip(), mlir::emitError(), mlir::MLIRContext::enableMultithreading(), mlir::PassManager::enableTiming(), mlir::PassManager::enableVerifier(), mlir::OwningOpRef< OpTy >::get(), mlir::get(), mlir::OpPassManager::getAnyOpAnchorName(), mlir::PassManager::getContext(), mlir::OpPassManager::getPasses(), mlir::MlirOptMainConfig::getReproducerFilename(), mlir::TimingManager::getRootScope(), mlir::OpPassManager::Implicit, mlir::MLIRContext::isMultithreadingEnabled(), mlir::makeReproducer(), mlir::TimingScope::nest(), mlir::parseSourceFileForTool(), mlir::PassManager::run(), mlir::BytecodeWriterConfig::setDesiredBytecodeVersion(), mlir::BytecodeWriterConfig::setElideResourceDataFlag(), mlir::MlirOptMainConfig::setupPassPipeline(), mlir::MlirOptMainConfig::shouldElideResourceDataFromBytecode(), mlir::MlirOptMainConfig::shouldEmitBytecode(), mlir::MlirOptMainConfig::shouldRunReproducer(), mlir::MlirOptMainConfig::shouldUseExplicitModule(), mlir::MlirOptMainConfig::shouldVerifyOnParsing(), mlir::MlirOptMainConfig::shouldVerifyPasses(), mlir::MlirOptMainConfig::shouldVerifyRoundtrip(), mlir::TimingScope::stop(), and mlir::writeBytecodeToFile().
|
static |
Definition at line 527 of file MlirOptMain.cpp.
References mlir::DialectRegistry::getDialectNames().
Referenced by mlir::MlirOptMain().
|
static |
Definition at line 534 of file MlirOptMain.cpp.
References mlir::printRegisteredPasses().
Referenced by mlir::MlirOptMain().
|
static |
Parses the memory buffer.
If successfully, run a series of passes against it and print the result.
Definition at line 451 of file MlirOptMain.cpp.
ManagedStatic<MlirOptMainConfigCLOptions> clOptionsConfig |
Definition at line 212 of file MlirOptMain.cpp.
Referenced by mlir::MlirOptMainConfig::createFromCLOptions(), and mlir::MlirOptMainConfig::registerCLOptions().