MCPcopy Create free account
hub / github.com/Amanieu/regalloc3 / check_skipped_inst

Method check_skipped_inst

src/debug_utils/checker.rs:561–579  ·  view source on GitHub ↗

Checks that no instructions were skipped and that instructions are processed in order. An exception is made for pure instructions which are allowed to be eliminated if their outputs are unused.

(&mut self, current_inst: Inst)

Source from the content-addressed store, hash-verified

559 /// An exception is made for pure instructions which are allowed to be
560 /// eliminated if their outputs are unused.
561 fn check_skipped_inst(&mut self, current_inst: Inst) -> Result<()> {
562 ensure!(
563 self.next_inst <= current_inst,
564 "Output instructions in wrong order: expected {}, got {current_inst}",
565 self.next_inst
566 );
567 while self.next_inst != current_inst {
568 ensure!(
569 self.output
570 .function()
571 .can_eliminate_dead_inst(self.next_inst),
572 "Output skipped non-pure {}",
573 self.next_inst
574 );
575 self.next_inst = self.next_inst.next();
576 }
577 self.next_inst = current_inst.next();
578 Ok(())
579 }
580
581 /// Checks that the allocation can hold values of the given bank.
582 fn check_bank(&self, alloc: Allocation, bank: RegBank) -> Result<()> {

Callers 2

check_blockMethod · 0.80
check_instMethod · 0.80

Calls 1

nextMethod · 0.45

Tested by

no test coverage detected