LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
llzk::ValueCopyDialectInterface Class Referenceabstract

Dialect hook for materializing independent storage for mutable value types. More...

#include <ValueCopy.h>

Inheritance diagram for llzk::ValueCopyDialectInterface:
[legend]
Collaboration diagram for llzk::ValueCopyDialectInterface:
[legend]

Public Member Functions

virtual bool canMaterializeValueCopy (mlir::Type type) const =0
 Return whether the value semantics of type can be preserved by either reusing the same SSA value or materializing independent mutable storage.
virtual std::string getValueCopyFailureReason (mlir::Type type) const
 Explain why this dialect cannot copy type. Called only after support is rejected.
virtual mlir::FailureOr< mlir::Value > materializeValueCopy (mlir::OpBuilder &builder, mlir::Location loc, mlir::Value source) const =0
 Preserve the value-copy semantics of source at the builder's insertion point.

Detailed Description

Dialect hook for materializing independent storage for mutable value types.

Implementations must recursively copy every mutable value child. Immutable scalar values and identity-bearing handles are handled by the common entry points below and do not require a dialect implementation.

Definition at line 25 of file ValueCopy.h.

Member Function Documentation

◆ canMaterializeValueCopy()

virtual bool llzk::ValueCopyDialectInterface::canMaterializeValueCopy ( mlir::Type type) const
pure virtual

Return whether the value semantics of type can be preserved by either reusing the same SSA value or materializing independent mutable storage.

Returning false means that reuse would introduce observable aliasing and this interface cannot currently construct the required independent copy.

◆ getValueCopyFailureReason()

std::string llzk::ValueCopyDialectInterface::getValueCopyFailureReason ( mlir::Type type) const
virtual

Explain why this dialect cannot copy type. Called only after support is rejected.

Definition at line 50 of file ValueCopy.cpp.

◆ materializeValueCopy()

virtual mlir::FailureOr< mlir::Value > llzk::ValueCopyDialectInterface::materializeValueCopy ( mlir::OpBuilder & builder,
mlir::Location loc,
mlir::Value source ) const
pure virtual

Preserve the value-copy semantics of source at the builder's insertion point.

Implementations may return source only when its type has no independently mutable payload. Otherwise they must construct independent storage or return failure.


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