Cranelift: add debug logs counting how many vcode instructions and blocks we lower to (#5332)
This commit is contained in:
@@ -39,6 +39,11 @@ pub fn compile<B: LowerBackend + TargetIsa>(
|
||||
lower.lower(b)?
|
||||
};
|
||||
|
||||
log::debug!(
|
||||
"Number of lowered vcode instructions: {}",
|
||||
vcode.num_insts()
|
||||
);
|
||||
log::debug!("Number of lowered vcode blocks: {}", vcode.num_blocks());
|
||||
trace!("vcode from lowering: \n{:?}", vcode);
|
||||
|
||||
// Perform register allocation.
|
||||
|
||||
@@ -665,6 +665,11 @@ impl<I: VCodeInst> VCode<I> {
|
||||
self.block_ranges.len()
|
||||
}
|
||||
|
||||
/// The number of lowered instructions.
|
||||
pub fn num_insts(&self) -> usize {
|
||||
self.insts.len()
|
||||
}
|
||||
|
||||
/// Get the successors for a block.
|
||||
pub fn succs(&self, block: BlockIndex) -> &[BlockIndex] {
|
||||
let (start, end) = self.block_succ_range[block.index()];
|
||||
|
||||
Reference in New Issue
Block a user