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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user