MLIR 22.0.0git
mlir::BytecodeReader::Impl Class Reference

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.
int64_t getNumOpsToMaterialize () const
 Return the number of ops that haven't been materialized yet.
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.
LogicalResult materializeAll ()
 Materialize all operations.
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.

Detailed Description

This class is used to read a bytecode buffer and translate it into MLIR.

Definition at line 1358 of file BytecodeReader.cpp.

Constructor & Destructor Documentation

◆ Impl()

mlir::BytecodeReader::Impl::Impl ( Location fileLoc,
const ParserConfig & config,
bool lazyLoading,
llvm::MemoryBufferRef buffer,
const std::shared_ptr< llvm::SourceMgr > & bufferOwnerRef )
inline

Definition at line 1366 of file BytecodeReader.cpp.

References mlir::get().

Member Function Documentation

◆ finalize()

LogicalResult mlir::BytecodeReader::Impl::finalize ( function_ref< bool(Operation *)> shouldMaterialize)
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 1415 of file BytecodeReader.cpp.

References mlir::Operation::dropAllReferences(), mlir::Operation::erase(), materialize(), and success().

◆ getNumOpsToMaterialize()

int64_t mlir::BytecodeReader::Impl::getNumOpsToMaterialize ( ) const
inline

Return the number of ops that haven't been materialized yet.

Definition at line 1384 of file BytecodeReader.cpp.

◆ isMaterializable()

bool mlir::BytecodeReader::Impl::isMaterializable ( Operation * op)
inline

Definition at line 1386 of file BytecodeReader.cpp.

◆ materialize()

LogicalResult mlir::BytecodeReader::Impl::materialize ( Operation * op,
llvm::function_ref< bool(Operation *)> lazyOpsCallback )
inline

Materialize the provided operation, invoke the lazyOpsCallback on every newly found lazy operation.

Definition at line 1391 of file BytecodeReader.cpp.

References materialize().

Referenced by finalize(), materialize(), and materializeAll().

◆ materializeAll()

LogicalResult mlir::BytecodeReader::Impl::materializeAll ( )
inline

Materialize all operations.

Definition at line 1403 of file BytecodeReader.cpp.

References materialize(), and success().

◆ read()


The documentation for this class was generated from the following file: