Skip to content

Commit

Permalink
Experiment: Don't merge vtables.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwoerister committed Oct 25, 2022
1 parent 31d754a commit 0247c6a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion compiler/rustc_codegen_llvm/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,14 @@ impl<'ll> CodegenCx<'ll, '_> {
};
llvm::LLVMSetInitializer(gv, cv);
set_global_alignment(self, gv, align);
llvm::SetUnnamedAddress(gv, llvm::UnnamedAddr::Global);

// Experiment: What's the impact of making vtables unmergable?
if kind == Some("vtable") {
llvm::SetUnnamedAddress(gv, llvm::UnnamedAddr::No);
} else {
llvm::SetUnnamedAddress(gv, llvm::UnnamedAddr::Global);
}

gv
}
}
Expand Down

0 comments on commit 0247c6a

Please sign in to comment.