More descriptive logging to help diagnose irreducible control flow
This commit is contained in:
parent
ec2a999359
commit
508620289f
|
@ -124,7 +124,14 @@ impl<'a, 'b> Context<'a, 'b> {
|
|||
|
||||
for (block_rpo, &block) in cfg.rpo.entries() {
|
||||
for &succ in &body.blocks[block].succs {
|
||||
log::trace!("block {} rpo {} has succ {}", block, block_rpo, succ);
|
||||
log::trace!(
|
||||
"block {} ({}) rpo {} has succ {} ({})",
|
||||
block,
|
||||
body.blocks[block].desc,
|
||||
block_rpo,
|
||||
succ,
|
||||
body.blocks[succ].desc,
|
||||
);
|
||||
let succ_rpo = cfg.rpo_pos[succ].unwrap();
|
||||
log::trace!(" -> succ rpo {}", succ_rpo);
|
||||
if succ_rpo <= block_rpo {
|
||||
|
|
|
@ -78,7 +78,14 @@ impl<'a> Display for FunctionBodyDisplay<'a> {
|
|||
.iter()
|
||||
.map(|(ty, val)| format!("{}: {}", val, ty))
|
||||
.collect::<Vec<_>>();
|
||||
writeln!(f, "{} {}({}):", self.1, block_id, block_params.join(", "))?;
|
||||
writeln!(
|
||||
f,
|
||||
"{} {}({}): # {}",
|
||||
self.1,
|
||||
block_id,
|
||||
block_params.join(", "),
|
||||
block.desc
|
||||
)?;
|
||||
writeln!(
|
||||
f,
|
||||
"{} # preds: {}",
|
||||
|
@ -86,7 +93,7 @@ impl<'a> Display for FunctionBodyDisplay<'a> {
|
|||
block
|
||||
.preds
|
||||
.iter()
|
||||
.map(|pred| format!("{}", pred))
|
||||
.map(|pred| format!("{} ({})", pred, self.0.blocks[*pred].desc))
|
||||
.collect::<Vec<_>>()
|
||||
.join(", ")
|
||||
)?;
|
||||
|
@ -97,7 +104,7 @@ impl<'a> Display for FunctionBodyDisplay<'a> {
|
|||
block
|
||||
.succs
|
||||
.iter()
|
||||
.map(|succ| format!("{}", succ))
|
||||
.map(|succ| format!("{} ({})", succ, self.0.blocks[*succ].desc))
|
||||
.collect::<Vec<_>>()
|
||||
.join(", ")
|
||||
)?;
|
||||
|
|
Loading…
Reference in a new issue