Skip to content

Commit 102c48c

Browse files
tekknolagik0kubun
authored andcommitted
Don't compute predecessors for infer_types (Shopify/zjit#78)
We don't need this anymore thanks to the push-driven type union for basic block arguments.
1 parent e5647d8 commit 102c48c

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

zjit/src/hir.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -657,22 +657,7 @@ impl Function {
657657
// We know that function parameters are BasicObject or some subclass
658658
self.insn_types[param.0] = types::BasicObject;
659659
}
660-
// Compute predecessor instructions for each block
661-
let mut preds: Vec<Vec<InsnId>> = vec![Vec::new(); self.blocks.len()];
662660
let rpo = self.rpo();
663-
// Walk the graph, computing predecessor blocks
664-
for block in &rpo {
665-
for insn_id in &self.blocks[block.0].insns {
666-
let insn = self.find(*insn_id);
667-
if let Insn::IfTrue { target, .. } | Insn::IfFalse { target, .. } | Insn::Jump(target) = insn {
668-
preds[target.target.0].push(*insn_id);
669-
}
670-
}
671-
}
672-
for idx in 0..preds.len() {
673-
preds[idx].sort();
674-
preds[idx].dedup();
675-
}
676661
// Walk the graph, computing types until fixpoint
677662
let mut reachable = vec![false; self.blocks.len()];
678663
reachable[self.entry_block.0] = true;

0 commit comments

Comments
 (0)