Skip to content

Commit 2894d58

Browse files
committed
Trim off a few more runtime checks
1 parent b95ff5c commit 2894d58

File tree

3 files changed

+1
-51
lines changed

3 files changed

+1
-51
lines changed

compiler/rustc_mir_transform/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -714,12 +714,9 @@ fn run_optimization_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
714714
&multiple_return_terminators::MultipleReturnTerminators,
715715
&deduplicate_blocks::DeduplicateBlocks,
716716
&large_enums::EnumSizeOpt { discrepancy: 128 },
717-
&add_call_guards::CriticalCallEdges,
718717
// Cleanup for human readability, off by default.
719718
&prettify::ReorderBasicBlocks,
720719
&prettify::ReorderLocals,
721-
// Dump the end result for testing and debugging purposes.
722-
&dump_mir::Marker("PreCodegen"),
723720
],
724721
Some(MirPhase::Runtime(RuntimePhase::Optimized)),
725722
);
@@ -795,6 +792,7 @@ pub fn build_codegen_mir<'tcx>(tcx: TyCtxt<'tcx>, instance: Instance<'tcx>) -> B
795792
&o1(simplify_branches::SimplifyConstCondition::PostMono),
796793
&o1(simplify::SimplifyCfg::PostMono),
797794
&add_call_guards::CriticalCallEdges,
795+
&dump_mir::Marker("PreCodegen"),
798796
],
799797
None,
800798
);

compiler/rustc_mir_transform/src/validate.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -386,23 +386,6 @@ impl<'a, 'tcx> Visitor<'tcx> for CfgChecker<'a, 'tcx> {
386386
}
387387
self.check_unwind_edge(location, unwind);
388388

389-
// The code generation assumes that there are no critical call edges. The
390-
// assumption is used to simplify inserting code that should be executed along
391-
// the return edge from the call. FIXME(tmiasko): Since this is a strictly code
392-
// generation concern, the code generation should be responsible for handling
393-
// it.
394-
if self.mir_phase >= MirPhase::Runtime(RuntimePhase::Optimized)
395-
&& self.is_critical_call_edge(target, unwind)
396-
{
397-
self.fail(
398-
location,
399-
format!(
400-
"encountered critical edge in `Call` terminator {:?}",
401-
terminator.kind,
402-
),
403-
);
404-
}
405-
406389
// The call destination place and Operand::Move place used as an argument might
407390
// be passed by a reference to the callee. Consequently they cannot be packed.
408391
if is_within_packed(self.tcx, &self.body.local_decls, destination).is_some() {

tests/ui/mir/validate/critical-edge.rs

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)