Skip to content

Commit b1d908a

Browse files
committed
code review
1 parent 2f781f3 commit b1d908a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/noirc_evaluator/src/ssa/opt/basic_conditional.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,14 @@ fn block_cost(block: BasicBlockId, dfg: &DataFlowGraph) -> u32 {
208208
}
209209
1
210210
},
211+
// if less than 10 elements, it is translated into a store for each element
212+
// if more than 10, it is a loop, so 10 should be a good estimate
213+
Instruction::MakeArray { .. } => 10,
211214

212215
Instruction::Allocate
213216
| Instruction::EnableSideEffectsIf { .. }
214217
| Instruction::IncrementRc { .. }
215218
| Instruction::DecrementRc { .. }
216-
| Instruction::MakeArray { .. }
217219
| Instruction::Noop => 0,
218220
Instruction::IfElse { .. } => 1,
219221
};

0 commit comments

Comments
 (0)