Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions compiler/noirc_evaluator/src/ssa/opt/defunctionalize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,17 @@ fn remove_first_class_functions_in_instruction(
*arg = map_value(*arg);
}
} else if let Instruction::MakeArray { typ, .. } = instruction {
let mut modified_type = false;
if let Some(rep) = replacement_type(typ) {
*typ = rep;
modified_type = true;
}

instruction.map_values_mut(map_value);

modified = true;
if modified_type {
modified = true;
}
} else {
instruction.map_values_mut(map_value);
}
Expand Down Expand Up @@ -578,7 +583,8 @@ fn create_apply_function(
// local_end_block3--/
//
// This is necessary since SSA panics during flattening if we immediately
// try to jump directly to end block instead: https://github.com/noir-lang/noir/issues/7323.
// try to jump directly to end block instead
// (see https://github.com/noir-lang/noir/issues/7323 for a case where this happens).
//
// It'd also be more efficient to merge them tournament-bracket style but that
// also leads to panics during flattening for similar reasons.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl Ssa {
return true;
}

// Check whether the only instruction is a recursive call, which prevents inlining the callee.
// Don't inline recursive functions
if recursive_functions.contains(&callee.id()) {
return false;
}
Expand Down
Loading