google / heir

A compiler for homomorphic encryption
https://heir.dev/
Apache License 2.0
306 stars 46 forks source link

move int64_t casting to `bgv-to-openfhe` #647

Closed j2kun closed 1 month ago

j2kun commented 5 months ago

I originally wrote the bgv-to-openfhe lowering without a complete understanding of the limitations of the OpenFHE API, which results in a decent amount of cruft related to casting types during OpenFHE codegen. For example, the input to an encode op in OpenFHE must be int64_t, but the codegen supports inputs of type int16_t and casts them in C++ generated code.

This is relatively small, but since this is part of the OpenFHE API, it would be more coherent to represent those constraints as openfhe op type constraints, and insert casting ops in the lowering from BGV to OpenFHE, and then have simpler codegen for the cast ops directly.

github-actions[bot] commented 5 months ago

This issue has 1 outstanding TODOs:

This comment was autogenerated by todo-backlinks