heir
heir copied to clipboard
Bug: secret-forget-secrets does not work after yosys optimizer
@j2kun - I thought it would be nice to check the Yosys optimizer pass for correctness by chaining yosys-optimizer with secret-forget-secrets and then lowering to LLVM to execute (this would have caught the bug)
The issue here seems to be that the secret.cast that transforms the multi-bit secrets to the tensor of single-bits has no conversion pattern. We already have code that extracts bits from plaintext multi-bits so we can use that here for an input conversion.
I lost the train of thought on this bug. Is there a simple reproducer for the error?
Sure! Maybe the add_one example is the easiest. It hits this bug on anything with a multi-bit integer value.
bazel run -c dbg @heir//tools:heir-opt -- --yosys-optimizer --canonicalize --cse --secret-forget-secrets $(pwd)/tests/yosys_optimizer/arith_ops.mlir