Skip to content

Commit 7005e3d

Browse files
committed
Remove bound on number of basic blocks.
1 parent 4a7dcff commit 7005e3d

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
@@ -23,7 +23,6 @@ use crate::MirPass;
2323

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

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

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

0 commit comments

Comments
 (0)