MLIR
20.0.0git
|
This class is used to read a bytecode buffer and translate it into MLIR. More...
Public Member Functions | |
Impl (Location fileLoc, const ParserConfig &config, bool lazyLoading, llvm::MemoryBufferRef buffer, const std::shared_ptr< llvm::SourceMgr > &bufferOwnerRef) | |
LogicalResult | read (Block *block, llvm::function_ref< bool(Operation *)> lazyOps) |
Read the bytecode defined within buffer into the given block. More... | |
int64_t | getNumOpsToMaterialize () const |
Return the number of ops that haven't been materialized yet. More... | |
bool | isMaterializable (Operation *op) |
LogicalResult | materialize (Operation *op, llvm::function_ref< bool(Operation *)> lazyOpsCallback) |
Materialize the provided operation, invoke the lazyOpsCallback on every newly found lazy operation. More... | |
LogicalResult | materializeAll () |
Materialize all operations. More... | |
LogicalResult | finalize (function_ref< bool(Operation *)> shouldMaterialize) |
Finalize the lazy-loading by calling back with every op that hasn't been materialized to let the client decide if the op should be deleted or materialized. More... | |
This class is used to read a bytecode buffer and translate it into MLIR.
Definition at line 1310 of file BytecodeReader.cpp.
|
inline |
Definition at line 1318 of file BytecodeReader.cpp.
|
inline |
Finalize the lazy-loading by calling back with every op that hasn't been materialized to let the client decide if the op should be deleted or materialized.
The op is materialized if the callback returns true, deleted otherwise.
Definition at line 1367 of file BytecodeReader.cpp.
References mlir::Operation::dropAllReferences(), mlir::Operation::erase(), and materialize().
|
inline |
Return the number of ops that haven't been materialized yet.
Definition at line 1336 of file BytecodeReader.cpp.
|
inline |
Definition at line 1338 of file BytecodeReader.cpp.
|
inline |
Materialize the provided operation, invoke the lazyOpsCallback on every newly found lazy operation.
Definition at line 1343 of file BytecodeReader.cpp.
Referenced by finalize(), and materializeAll().
|
inline |
Materialize all operations.
Definition at line 1355 of file BytecodeReader.cpp.
References materialize().
LogicalResult BytecodeReader::Impl::read | ( | Block * | block, |
llvm::function_ref< bool(Operation *)> | lazyOps | ||
) |
Read the bytecode defined within buffer
into the given block.
Definition at line 1631 of file BytecodeReader.cpp.
References diag(), isSectionOptional(), mlir::bytecode::Section::kAttrType, mlir::bytecode::Section::kAttrTypeOffset, mlir::bytecode::Section::kDialect, mlir::bytecode::Section::kIR, mlir::bytecode::Section::kNumSections, mlir::bytecode::Section::kProperties, mlir::bytecode::Section::kResource, mlir::bytecode::Section::kResourceOffset, mlir::bytecode::Section::kString, and mlir::toString().
Referenced by readBytecodeFileImpl().