Preprocessing
‘preprocessing’ Dialect
The preprocessing dialect defines operations and types for
representing sever-side plaintext preprocessing. The dialect
is meant as a structural intermediate dialect to support the
split-preprocessing pass.
Preprocessing types
PreprocessingStorageType
A storage type wrapping an ordered list of element types
Syntax:
!preprocessing.storage<
::llvm::ArrayRef<mlir::Type> # elementTypes
>
This type is an abstraction over memref (or similar containers) holding an ordered list of element types for multi-type storage, where the exact layout is not yet decided.
This allows us to manage server-side plaintext preprocessing as a single
SSA value, hiding details such as whether there are multiple plaintext types
that need handling. These details are determined by a later pass that lowers
preprocessing.storage to a backend-specific data structure, often a 1D memref,
and defers the exact description of that layout until it is easier to determine.
Parameters:
| Parameter | C++ type | Description |
|---|---|---|
| elementTypes | ::llvm::ArrayRef<mlir::Type> |
Preprocessing ops
preprocessing.empty (heir::preprocessing::EmptyOp)
Allocate an empty preprocessing storage
Syntax:
operation ::= `preprocessing.empty` attr-dict `:` type($storage)
This op creates a new preprocessing.storage value with an undetermined size.
Results:
| Result | Description |
|---|---|
storage | A storage type wrapping an ordered list of element types |
preprocessing.load (heir::preprocessing::LoadOp)
Load a value from preprocessing storage at given indices and site_id
Syntax:
operation ::= `preprocessing.load` $storage `[` $indices `]` `site` $site_id `<` $element_type `>` attr-dict `:` type($storage) `,` type($result)
This op loads a value from a preprocessing.storage, while tracking:
- The type being stored.
- The
site_idit came from, which corresponds to an encode op the value is used in. - An (optional) multiset of indices corresponding to a particular iteration of a loop nest.
In preprocessing-to-memref, this op lowers to extracting a plaintext from
a memref.
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
site_id | ::mlir::IntegerAttr | 32-bit signless integer attribute |
element_type | ::mlir::TypeAttr | any type attribute |
Operands:
| Operand | Description |
|---|---|
storage | A storage type wrapping an ordered list of element types |
indices | variadic of index |
Results:
| Result | Description |
|---|---|
result | any non-token type |
preprocessing.store (heir::preprocessing::StoreOp)
Store a value to preprocessing storage at given indices and site_id
Syntax:
operation ::= `preprocessing.store` $value `,` $storage `[` $indices `]` `site` $site_id `<` $element_type `>` attr-dict `:` type($value) `,` type($storage)
This op stores a value into a preprocessing.storage, while tracking:
- The type being stored.
- The
site_idit came from, which corresponds to an encode op the value is used in. - An (optional) multiset of indices corresponding to a particular iteration of a loop nest.
In preprocessing-to-memref, this op lowers to storing a plaintext in a
memref.
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
site_id | ::mlir::IntegerAttr | 32-bit signless integer attribute |
element_type | ::mlir::TypeAttr | any type attribute |
Operands:
| Operand | Description |
|---|---|
value | any non-token type |
storage | A storage type wrapping an ordered list of element types |
indices | variadic of index |