Make sequence numbers local to instructions (#6043)

* Only allow pp_cmp within a single block

Block order shouldn't matter for codegen and restricting pp_cmp to a
single block will allow making instruction sequence numbers local to a
block.

* Make sequence numbers local to instructions

This allows renumbering to be localized to a single block where previously it
could affect the entire function. Also saves 32bit of overhead per block.
This commit is contained in:
bjorn3
2023-03-17 21:53:21 +01:00
committed by GitHub
parent 90d3eff0f3
commit 2c40c267d4
3 changed files with 48 additions and 154 deletions

View File

@@ -164,7 +164,15 @@ impl<'a> CacheKey<'a> {
// Make sure the blocks and instructions are sequenced the same way as we might
// have serialized them earlier. This is the symmetric of what's done in
// `try_load`.
f.stencil.layout.full_renumber();
let mut block = f.stencil.layout.entry_block().expect("Missing entry block");
loop {
f.stencil.layout.full_block_renumber(block);
if let Some(next_block) = f.stencil.layout.next_block(block) {
block = next_block;
} else {
break;
}
}
CacheKey {
stencil: &f.stencil,
parameters: CompileParameters::from_isa(isa),