Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ssa): rename codegen to ssa_gen + reorg of Value struct #797

Merged
merged 10 commits into from
Feb 11, 2023
4 changes: 2 additions & 2 deletions crates/noirc_evaluator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use errors::{RuntimeError, RuntimeErrorKind};
use iter_extended::btree_map;
use noirc_abi::{AbiType, AbiVisibility};
use noirc_frontend::monomorphization::ast::*;
use ssa::{code_gen::IRGenerator, node};
use ssa::{node, ssa_gen::IRGenerator};
use std::collections::BTreeMap;

pub struct Evaluator {
Expand Down Expand Up @@ -114,7 +114,7 @@ impl Evaluator {
self.parse_abi_alt(&mut ir_gen);

// Now call the main function
ir_gen.codegen_main()?;
ir_gen.ssa_gen_main()?;

//Generates ACIR representation:
ir_gen.context.ir_to_acir(self, enable_logging)?;
Expand Down
8 changes: 4 additions & 4 deletions crates/noirc_evaluator/src/ssa/function.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use crate::errors::RuntimeError;
use crate::ssa::{
block::BlockId,
code_gen::IRGenerator,
conditional::{AssumptionId, DecisionTree, TreeBuilder},
context::SsaContext,
mem::ArrayId,
node::{Node, NodeId, ObjectType, Opcode, Operation},
ssa_gen::IRGenerator,
{block, builtin, node, ssa_form},
};
use iter_extended::try_vecmap;
Expand Down Expand Up @@ -173,7 +173,7 @@ impl IRGenerator {
self.context.functions.insert(func_id, func.clone());

let function_body = self.program.take_function_body(func_id);
let last_value = self.codegen_expression(&function_body)?;
let last_value = self.ssa_gen_expression(&function_body)?;
let return_values = last_value.to_node_ids();

func.result_types.clear();
Expand Down Expand Up @@ -227,8 +227,8 @@ impl IRGenerator {

//generates an instruction for calling the function
pub fn call(&mut self, call: &Call) -> Result<Vec<NodeId>, RuntimeError> {
let func = self.codegen_expression(&call.func)?.unwrap_id();
let arguments = self.codegen_expression_list(&call.arguments);
let func = self.ssa_gen_expression(&call.func)?.unwrap_id();
let arguments = self.ssa_gen_expression_list(&call.arguments);

if let Some(opcode) = self.context.get_builtin_opcode(func) {
return self.call_low_level(opcode, arguments);
Expand Down
3 changes: 2 additions & 1 deletion crates/noirc_evaluator/src/ssa/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ pub mod acir_gen;
mod anchor;
mod block;
mod builtin;
pub mod code_gen;
mod conditional;
mod context;
mod flatten;
Expand All @@ -13,3 +12,5 @@ mod mem;
pub mod node;
mod optimizations;
mod ssa_form;
pub mod ssa_gen;
mod value;
Loading