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): Replace JmpIf with BrIf #1193

Merged
merged 4 commits into from
Apr 21, 2023
Merged
Changes from 1 commit
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
14 changes: 9 additions & 5 deletions crates/noirc_evaluator/src/ssa_refactor/ir/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,16 @@ impl Instruction {
pub(crate) enum TerminatorInstruction {
/// Control flow
///
/// Jump If
/// Branch If
///
/// Jumps to the specified `destination` with
/// arguments, if the condition
/// if the condition is true.
JmpIf { condition: ValueId, destination: BasicBlockId, arguments: BlockArguments },
/// Branches to the specified `then_destination` with `arguments` if the condition is true,
/// otherwise branches to the `else_destination` with `arguments`.
joss-aztec marked this conversation as resolved.
Show resolved Hide resolved
BrIf {
condition: ValueId,
then_destination: BasicBlockId,
else_destination: BasicBlockId,
arguments: BlockArguments,
},
/// Unconditional Jump
///
/// Jumps to specified `destination` with `arguments`
Expand Down