about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2021-01-16 13:05:23 +0100
committerbjorn3 <bjorn3@users.noreply.github.com>2021-01-16 13:05:23 +0100
commitcfedad1f75bf22468fce59f754daf1501fa2827d (patch)
tree090fc5fee07b8af1ae732bb71c8df924bc134fe7
parent1952b1ffaee277a6d10ba6aabf7fa9a3f87383c5 (diff)
downloadrust-cfedad1f75bf22468fce59f754daf1501fa2827d.tar.gz
rust-cfedad1f75bf22468fce59f754daf1501fa2827d.zip
Clear domtree after cg_clif optimizations
-rw-r--r--src/base.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/base.rs b/src/base.rs
index 34c9561d676..757915ba99a 100644
--- a/src/base.rs
+++ b/src/base.rs
@@ -117,6 +117,9 @@ pub(crate) fn codegen_fn<'tcx>(
     context.compute_domtree();
     context.eliminate_unreachable_code(cx.module.isa()).unwrap();
     context.dce(cx.module.isa()).unwrap();
+    // Some Cranelift optimizations expect the domtree to not yet be computed and as such don't
+    // invalidate it when it would change.
+    context.domtree.clear();
 
     context.want_disasm = crate::pretty_clif::should_write_ir(tcx);