Skip to content

Commit 4215859

Browse files
committed
make const-prop use cached RPO
1 parent 066d381 commit 4215859

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_mir_transform/src/const_prop.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ impl<'tcx> MirPass<'tcx> for ConstProp {
118118

119119
// Traverse the body in reverse post-order, to ensure that `FullConstProp` locals are
120120
// assigned before being read.
121-
let postorder = body.basic_blocks.postorder().to_vec();
122-
for bb in postorder.into_iter().rev() {
121+
let rpo = body.basic_blocks.reverse_postorder().to_vec();
122+
for bb in rpo {
123123
let data = &mut body.basic_blocks.as_mut_preserves_cfg()[bb];
124124
optimization_finder.visit_basic_block_data(bb, data);
125125
}

0 commit comments

Comments
 (0)