Skip to content

Commit

Permalink
feat: Brillig IR refactor (#5233)
Browse files Browse the repository at this point in the history
Split brillig IR in low level instructions and higher level codegen
files that compose the instructions and restrict visibilities. This
should not have any business logic change. This also fixes debug_show by
only printing the low level instructions, previously we were printing
both the high level codegen and the low level instructions and it was a
mess to read.
  • Loading branch information
sirasistant authored Mar 15, 2024
1 parent 08f9038 commit 9a73348
Show file tree
Hide file tree
Showing 15 changed files with 1,432 additions and 1,391 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ pub(crate) fn convert_black_box_call(
) = (function_arguments, function_results)
{
let message_hash = convert_array_or_vector(brillig_context, message, bb_func);
let signature = brillig_context.array_to_vector(signature);
let signature = brillig_context.array_to_vector_instruction(signature);
brillig_context.black_box_op_instruction(BlackBoxOp::SchnorrVerify {
public_key_x: public_key_x.address,
public_key_y: public_key_y.address,
Expand Down Expand Up @@ -368,7 +368,7 @@ fn convert_array_or_vector(
bb_func: &BlackBoxFunc,
) -> BrilligVector {
match array_or_vector {
BrilligVariable::BrilligArray(array) => brillig_context.array_to_vector(array),
BrilligVariable::BrilligArray(array) => brillig_context.array_to_vector_instruction(array),
BrilligVariable::BrilligVector(vector) => *vector,
_ => unreachable!(
"ICE: {} expected an array or a vector, but got {:?}",
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading

0 comments on commit 9a73348

Please sign in to comment.