Skip to content

Commit 66b7e3d

Browse files
committed
Remove bound on number of basic blocks.
1 parent f7dd53d commit 66b7e3d

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

compiler/rustc_mir_transform/src/dataflow_const_prop.rs

-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ use crate::MirPass;
2121

2222
// These constants are somewhat random guesses and have not been optimized.
2323
// If `tcx.sess.mir_opt_level() >= 4`, we ignore the limits (this can become very expensive).
24-
const BLOCK_LIMIT: usize = 100;
2524
const PLACE_LIMIT: usize = 100;
2625

2726
pub struct ConstProp;
@@ -34,10 +33,6 @@ impl<'tcx> MirPass<'tcx> for ConstProp {
3433
#[instrument(skip_all level = "debug")]
3534
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
3635
debug!(def_id = ?body.source.def_id());
37-
if tcx.sess.mir_opt_level() < 4 && body.basic_blocks.len() > BLOCK_LIMIT {
38-
debug!("aborted dataflow const prop due too many basic blocks");
39-
return;
40-
}
4136

4237
// We want to have a somewhat linear runtime w.r.t. the number of statements/terminators.
4338
// Let's call this number `n`. Dataflow analysis has `O(h*n)` transfer function

0 commit comments

Comments
 (0)