Skip to content

Commit

Permalink
Merge pull request #957 from vext01/first-block-bug
Browse files Browse the repository at this point in the history
First block bug
  • Loading branch information
ltratt authored Feb 7, 2024
2 parents ba96cb6 + 3ef9206 commit f3d7537
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
3 changes: 1 addition & 2 deletions tests/c/simple.newcg.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// # Currently this test breaks CI entirely, so we temporarily ignore it
// # completely.
// ignore-if: true
// # ignore-if: test $YK_JIT_COMPILER != "yk"
// ignore-if: test $YK_JIT_COMPILER != "yk"
// Run-time:
// env-var: YKD_PRINT_IR=aot
// env-var: YKD_SERIALISE_COMPILATION=1
Expand Down
17 changes: 16 additions & 1 deletion ykrt/src/compile/jitc_yk/trace_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,22 @@ impl<'a> TraceBuilder<'a> {
Some(b) => Ok(b),
None => Err(CompilationError::Unrecoverable("empty trace".into())),
}?;
let firstblk = self.lookup_aot_block(first_blk);

// Find the block containing the control point call. This is the (sole) predecessor of the
// first (guaranteed mappable) block in the trace.
let prev = match first_blk {
TracedAOTBlock::Mapped { func_name, bb } => {
debug_assert!(*bb > 0);
// It's `- 1` due to the way the ykllvm block splitting pass works.
TracedAOTBlock::Mapped {
func_name: func_name.clone(),
bb: bb - 1,
}
}
TracedAOTBlock::Unmappable => panic!(),
};

let firstblk = self.lookup_aot_block(&prev);
// FIXME: This unwrap assumes the first block is mappable, but Laurie just merged a change
// that strips the initial block (the block we return to from the control point), so I
// don't think this assumption necessarily holds any more. Investigate.
Expand Down

0 comments on commit f3d7537

Please sign in to comment.