From 5bdb4a1737742193911e0abc037869744ce9d2a5 Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Thu, 1 Dec 2022 23:16:21 -0800 Subject: [PATCH] WIP. --- src/ir/func.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ir/func.rs b/src/ir/func.rs index a4b043e..13ced6c 100644 --- a/src/ir/func.rs +++ b/src/ir/func.rs @@ -224,6 +224,10 @@ impl FunctionBody { let cfg = CFGInfo::new(self); let mut bad = vec![]; for (block, block_def) in self.blocks.entries() { + // If block isn't reachable, skip it. + if cfg.rpo_pos[block].is_none() { + continue; + } let mut visit_use = |u: Value, i: Option, inst: Option| { let u = self.resolve_alias(u); if block_inst[u].is_none() {