Disable SimplifyBranchSame optimization for now

This commit is contained in:
Fabian Wolff 2021-10-03 22:58:24 +02:00
parent 20489eaca2
commit dd9b4763a4

View file

@ -544,6 +544,12 @@ pub struct SimplifyBranchSame;
impl<'tcx> MirPass<'tcx> for SimplifyBranchSame {
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
// This optimization is disabled by default for now due to
// soundness concerns; see issue #89485 and PR #89489.
if !tcx.sess.opts.debugging_opts.unsound_mir_opts {
return;
}
trace!("Running SimplifyBranchSame on {:?}", body.source);
let finder = SimplifyBranchSameOptimizationFinder { body, tcx };
let opts = finder.find();