Skip non-branching blocks now that we're using basic blocks

This is a rebase of [1]. In the long term, we'll want to simplify these
analysis passes. For now, this is simple and will reduce the number of
instructions processed in certain cases.

[1] https://github.com/bytecodealliance/cranelift/pull/866
This commit is contained in:
Ryan Hunt
2020-03-03 13:34:04 -06:00
committed by Benjamin Bouvier
parent 135a48ca7e
commit 4aa8776a9b
4 changed files with 21 additions and 3 deletions

View File

@@ -120,7 +120,7 @@ impl ControlFlowGraph {
}
fn compute_block(&mut self, func: &Function, block: Block) {
for inst in func.layout.block_insts(block) {
for inst in func.layout.block_likely_branches(block) {
match func.dfg.analyze_branch(inst) {
BranchInfo::SingleDest(dest, _) => {
self.add_edge(block, inst, dest);