Cleanup used attribute for heir-translate
- Dominant language
- MLIR
- Stars
- 906
- Forks
- 171
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 32
Description
Currently there are `bgv.schemeParam` and `mgmt.openfhe_params` annotated after the final pass, and some of them are not recognized by `heir-translate`
```bash
# not providing entry-function=dot_product to pass by the manual cleanup in configure-crypto-context
--mlir-to-bgv=ciphertext-degree=8 --scheme-to-lattigo $PWD/tests/Examples/lattigo/dot_product_8.mlir
```
```mlir
module attributes {bgv.schemeParam = #bgv.scheme_param, scheme.bgv} {
func.func @dot_product(...) -> !lattigo.rlwe.ciphertext attributes {mgmt.openfhe_params = #mgmt.openfhe_params}
```
After feeding to `heir-translate`, we get
```
:1:43: error: #"bgv"<"scheme_param"> : 'none' attribute created with unregistered dialect. If this is intended, please call allowUnregisteredDialects() on the MLIRContext, or use -allow-unregistered-dialect with the MLIR opt tool used
```
The workaround is to register bgv dialect in the translater, but I think this is quite redundant. There should be some pass responsible for clean it up, especially when the user manually types all the passes or the user has a typo in the pipeline (e.g. `--scheme-to-lattigo=entry-function=product` then the user would face the error)
Contributor guide
Assessment
This issue has not been assessed yet.