Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
2 changes: 2 additions & 0 deletions compiler/noirc_evaluator/src/ssa/opt/checked_to_unchecked.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ mod tests {
b0(v0: u1, v1: i32):
v2 = cast v0 as i32
v3 = mul v2, v1
v4 = cast v3 as u64
v6 = truncate v4 to 32 bits, max_bit_size: 64
return v2
}
";
Expand Down
4 changes: 2 additions & 2 deletions compiler/noirc_evaluator/src/ssa/opt/loop_invariant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@ mod test {
v9 = unchecked_add v2, i32 1
jmp b1(v9)
b6():
v10 = mul v0, v1
v10 = unchecked_mul v0, v1
constrain v10 == i32 6
v12 = unchecked_add v3, i32 1
jmp b4(v12)
Expand All @@ -1110,7 +1110,7 @@ mod test {
let expected = "
brillig(inline) fn main f0 {
b0(v0: i32, v1: i32):
v4 = mul v0, v1
v4 = unchecked_mul v0, v1
constrain v4 == i32 6
jmp b1(i32 0)
b1(v2: i32):
Expand Down
4 changes: 2 additions & 2 deletions compiler/noirc_evaluator/src/ssa/opt/unrolling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@
use super::{BoilerplateStats, Loops, is_new_size_ok};

/// Tries to unroll all loops in each SSA function once, calling the `Function` directly,
/// bypassing the iterative loop done by the SSA which does further optimisations.

Check warning on line 1051 in compiler/noirc_evaluator/src/ssa/opt/unrolling.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (optimisations)
///
/// If any loop cannot be unrolled, it is left as-is or in a partially unrolled state.
fn try_unroll_loops(mut ssa: Ssa) -> (Ssa, Vec<RuntimeError>) {
Expand Down Expand Up @@ -1490,9 +1490,9 @@
v11 = array_get v0, index v10 -> u64
v12 = add v11, u64 1
v13 = array_set v9, index v10, value v12
v15 = add v1, {idx_type} 1
v15 = unchecked_add v1, {idx_type} 1
store v13 at v4
v16 = add v1, {idx_type} 1 // duplicate
v16 = unchecked_add v1, {idx_type} 1 // duplicate
jmp b1(v16)
b2():
v8 = load v4 -> [u64; 6]
Expand Down
5 changes: 0 additions & 5 deletions compiler/noirc_evaluator/src/ssa/parser/into_ssa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
value::ValueId,
},
opt::pure::FunctionPurities,
validation::validate_function,
};

use super::{
Expand Down Expand Up @@ -187,7 +186,7 @@

/// Computes the order in which blocks should be translated. The order will be according
/// to the block terminators, starting from the entry block. This is needed because a variable
/// in a block might refer to a variable that syntantically happens afterwards, but logically

Check warning on line 189 in compiler/noirc_evaluator/src/ssa/parser/into_ssa.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (syntantically)
/// happens before.
fn compute_blocks_order(
&self,
Expand Down Expand Up @@ -558,10 +557,6 @@
// before each print.
ssa.normalize_ids();

for function in ssa.functions.values() {
validate_function(function);
}
Comment on lines -561 to -563
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this gone? (maybe it's already done somewhere else and this was redundant?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was redundant. It was being done in FunctionBuilder::finish


ssa
}

Expand Down
Loading
Loading