Add LLVM attributes in batches instead of individually

This should improve performance.
This commit is contained in:
Erik Desjardins 2022-02-21 11:19:16 -05:00
parent 6f681a8eb3
commit 30d3ce0674
11 changed files with 451 additions and 473 deletions

View file

@ -95,7 +95,8 @@ pub fn compile_codegen_unit(tcx: TyCtxt<'_>, cgu_name: Symbol) -> (ModuleCodegen
// If this codegen unit contains the main function, also create the
// wrapper here
if let Some(entry) = maybe_create_entry_wrapper::<Builder<'_, '_, '_>>(&cx) {
attributes::sanitize(&cx, SanitizerSet::empty(), entry);
let attrs = attributes::sanitize_attrs(&cx, SanitizerSet::empty());
attributes::apply_to_llfn(entry, llvm::AttributePlace::Function, &attrs);
}
// Run replace-all-uses-with for statics that need it