Add an unreachable code elimination pass.

The register allocator doesn't even try to compile unreachable EBBs, so
any values defined in such blocks won't be assigned registers.

Since the dominator tree already has determined which EBBs are
reachable, we should just eliminate any unreachable blocks instead o
trying to do something with the dead code.

Not that this is not a "dead code elimination" pass which would also
remove individual instructions whose results are not used.
This commit is contained in:
Jakob Stoklund Olesen
2017-10-09 15:24:15 -07:00
parent 6aeeaebbd3
commit 90ed698e83
5 changed files with 126 additions and 0 deletions

View File

@@ -42,4 +42,5 @@ mod scoped_hash_map;
mod simple_gvn;
mod stack_layout;
mod topo_order;
mod unreachable_code;
mod write;