Skip to content

Commit cfedad1

Browse files
committed
Clear domtree after cg_clif optimizations
1 parent 1952b1f commit cfedad1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/base.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ pub(crate) fn codegen_fn<'tcx>(
117117
context.compute_domtree();
118118
context.eliminate_unreachable_code(cx.module.isa()).unwrap();
119119
context.dce(cx.module.isa()).unwrap();
120+
// Some Cranelift optimizations expect the domtree to not yet be computed and as such don't
121+
// invalidate it when it would change.
122+
context.domtree.clear();
120123

121124
context.want_disasm = crate::pretty_clif::should_write_ir(tcx);
122125

0 commit comments

Comments
 (0)