Stop using cfg.postorder_ebbs().

Switch to the new domtree.cfg_postorder() which returns a reference to a
pre-computed post-order instead of allocating memory and computing a new
post-order.
This commit is contained in:
Jakob Stoklund Olesen
2017-06-07 13:38:27 -07:00
parent 0d227fd230
commit f22461b4b3
4 changed files with 12 additions and 10 deletions

View File

@@ -19,10 +19,9 @@ pub fn do_simple_gvn(func: &mut Function, cfg: &mut ControlFlowGraph) {
let domtree = DominatorTree::with_function(func, &cfg);
// Visit EBBs in a reverse post-order.
let mut postorder = cfg.postorder_ebbs();
let mut pos = Cursor::new(&mut func.layout);
while let Some(ebb) = postorder.pop() {
for &ebb in domtree.cfg_postorder().iter().rev() {
pos.goto_top(ebb);
while let Some(inst) = pos.next_inst() {