1
Fork 0

Add a codegen option to allow loading LLVM pass plugins

This commit is contained in:
Axel Cohen 2021-11-19 17:01:41 +01:00
parent 4a7fb971c9
commit 97cf461b8f
6 changed files with 30 additions and 1 deletions

View file

@ -470,6 +470,8 @@ pub(crate) unsafe fn optimize_with_new_llvm_pass_manager(
let extra_passes = config.passes.join(",");
let pass_plugins = config.pass_plugins.join(" ");
// FIXME: NewPM doesn't provide a facility to pass custom InlineParams.
// We would have to add upstream support for this first, before we can support
// config.inline_threshold and our more aggressive default thresholds.
@ -499,6 +501,8 @@ pub(crate) unsafe fn optimize_with_new_llvm_pass_manager(
selfprofile_after_pass_callback,
extra_passes.as_ptr().cast(),
extra_passes.len(),
pass_plugins.as_ptr().cast(),
pass_plugins.len(),
);
result.into_result().map_err(|()| llvm_err(diag_handler, "failed to run LLVM passes"))
}