about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRémy Rakic <remy.rakic+github@gmail.com>2023-06-14 19:57:23 +0000
committerRémy Rakic <remy.rakic+github@gmail.com>2023-06-14 20:08:04 +0000
commit4215859617a1037955db1150719c6faed2ce32a1 (patch)
tree8814f44ae17877957d03b53136d54c23cdf49d14
parent066d38190bb5e086d7ab565bc46d71b49c6d5217 (diff)
downloadrust-4215859617a1037955db1150719c6faed2ce32a1.tar.gz
rust-4215859617a1037955db1150719c6faed2ce32a1.zip
make const-prop use cached RPO
-rw-r--r--compiler/rustc_mir_transform/src/const_prop.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_mir_transform/src/const_prop.rs b/compiler/rustc_mir_transform/src/const_prop.rs
index 1d43dbda0aa..2f2c7357b00 100644
--- a/compiler/rustc_mir_transform/src/const_prop.rs
+++ b/compiler/rustc_mir_transform/src/const_prop.rs
@@ -118,8 +118,8 @@ impl<'tcx> MirPass<'tcx> for ConstProp {
 
         // Traverse the body in reverse post-order, to ensure that `FullConstProp` locals are
         // assigned before being read.
-        let postorder = body.basic_blocks.postorder().to_vec();
-        for bb in postorder.into_iter().rev() {
+        let rpo = body.basic_blocks.reverse_postorder().to_vec();
+        for bb in rpo {
             let data = &mut body.basic_blocks.as_mut_preserves_cfg()[bb];
             optimization_finder.visit_basic_block_data(bb, data);
         }