Eliminate duplication of RPO calculation for mir

add `postorder_cache` to mir Body

add `ReversePostorderCache` struct

correct struct name and comments
This commit is contained in:
SparrowLii 2022-04-28 11:31:08 +08:00
parent c95346b8ac
commit 7149bbcdc5
4 changed files with 96 additions and 7 deletions

View file

@ -244,7 +244,6 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
fx.debug_introduce_locals(&mut bx);
// Codegen the body of each block using reverse postorder
// FIXME(eddyb) reuse RPO iterator between `analysis` and this.
for (bb, _) in traversal::reverse_postorder(&mir) {
fx.codegen_block(bb);
}