Skip to content
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
Prev Previous commit
Next Next commit
no_redundant_nops
  • Loading branch information
ShaharNaveh committed Jun 24, 2026
commit d6b85581bdf98d6947d5cb4a6a48308904535060
14 changes: 7 additions & 7 deletions crates/codegen/src/ir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2301,7 +2301,7 @@ impl Blocks {
let res = self.remove_redundant_nops()?;

#[cfg(debug_assertions)]
assert!(no_redundant_nops(self));
assert!(self.no_redundant_nops());

Ok(res)
}
Expand Down Expand Up @@ -2889,6 +2889,12 @@ impl Blocks {
}
Ok(changes)
}

/// flowgraph.c no_redundant_nops
#[cfg(debug_assertions)]
fn no_redundant_nops(&mut self) -> bool {
matches!(self.remove_redundant_nops(), Ok(0))
}
}

impl From<Vec<Block>> for Blocks {
Expand Down Expand Up @@ -5919,12 +5925,6 @@ fn is_conditional_jump_opcode(instr: AnyInstruction) -> bool {
)
}

/// flowgraph.c no_redundant_nops
#[cfg(debug_assertions)]
fn no_redundant_nops(blocks: &mut Blocks) -> bool {
matches!(blocks.remove_redundant_nops(), Ok(0))
}

/// flowgraph.c remove_redundant_jumps
fn remove_redundant_jumps(blocks: &mut Blocks) -> crate::InternalResult<usize> {
let mut changes = 0;
Expand Down