make const-prop use cached RPO
This commit is contained in:
parent
066d38190b
commit
4215859617
1 changed files with 2 additions and 2 deletions
|
@ -118,8 +118,8 @@ impl<'tcx> MirPass<'tcx> for ConstProp {
|
||||||
|
|
||||||
// Traverse the body in reverse post-order, to ensure that `FullConstProp` locals are
|
// Traverse the body in reverse post-order, to ensure that `FullConstProp` locals are
|
||||||
// assigned before being read.
|
// assigned before being read.
|
||||||
let postorder = body.basic_blocks.postorder().to_vec();
|
let rpo = body.basic_blocks.reverse_postorder().to_vec();
|
||||||
for bb in postorder.into_iter().rev() {
|
for bb in rpo {
|
||||||
let data = &mut body.basic_blocks.as_mut_preserves_cfg()[bb];
|
let data = &mut body.basic_blocks.as_mut_preserves_cfg()[bb];
|
||||||
optimization_finder.visit_basic_block_data(bb, data);
|
optimization_finder.visit_basic_block_data(bb, data);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue