rust/compiler/rustc_codegen_llvm/src
bors 1b3a5f29dd Auto merge of #91125 - eskarn:llvm-passes-plugin-support, r=nagisa
Allow loading LLVM plugins with both legacy and new pass manager

Opening a draft PR to get feedback and start discussion on this feature. There is already a codegen option `passes` which allow giving a list of LLVM pass names, however we currently can't use a LLVM pass plugin (as described here : https://llvm.org/docs/WritingAnLLVMPass.html), the only available passes are the LLVM built-in ones.

The proposed modification would be to add another codegen option `pass-plugins`, which can be set with a list of paths to shared library files. These libraries are loaded using the LLVM function `PassPlugin::Load`, which calls the expected symbol `lvmGetPassPluginInfo`, and register the pipeline parsing and optimization callbacks.

An example usage with a single plugin and 3 passes would look like this in the `.cargo/config`:

```toml
rustflags = [
    "-C", "pass-plugins=/tmp/libLLVMPassPlugin",
    "-C", "passes=pass1 pass2 pass3",
]
```
This would give the same functionality as the opt LLVM tool directly integrated in rust build system.

Additionally, we can also not specify the `passes` option, and use a plugin which inserts passes in the optimization pipeline, as one could do using clang.
2021-12-30 02:53:09 +00:00
..
back Auto merge of #91125 - eskarn:llvm-passes-plugin-support, r=nagisa 2021-12-30 02:53:09 +00:00
coverageinfo Remove in_band_lifetimes from rustc_codegen_llvm 2021-12-16 14:43:32 -05:00
debuginfo Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
llvm Auto merge of #91125 - eskarn:llvm-passes-plugin-support, r=nagisa 2021-12-30 02:53:09 +00:00
abi.rs Remove in_band_lifetimes from rustc_codegen_llvm 2021-12-16 14:43:32 -05:00
allocator.rs Include debug info for the allocator shim 2021-08-31 15:24:20 -07:00
asm.rs Remove in_band_lifetimes from rustc_codegen_llvm 2021-12-16 14:43:32 -05:00
attributes.rs Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
base.rs Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
builder.rs Remove in_band_lifetimes from rustc_codegen_llvm 2021-12-16 14:43:32 -05:00
callee.rs Remove in_band_lifetimes from rustc_codegen_llvm 2021-12-16 14:43:32 -05:00
common.rs Remove in_band_lifetimes from rustc_codegen_llvm 2021-12-16 14:43:32 -05:00
consts.rs Remove in_band_lifetimes from rustc_codegen_llvm 2021-12-16 14:43:32 -05:00
context.rs Auto merge of #88354 - Jmc18134:hint-space-pauth-opt, r=nagisa 2021-12-29 22:35:11 +00:00
declare.rs Auto merge of #88354 - Jmc18134:hint-space-pauth-opt, r=nagisa 2021-12-29 22:35:11 +00:00
intrinsic.rs Remove in_band_lifetimes from rustc_codegen_llvm 2021-12-16 14:43:32 -05:00
lib.rs Remove in_band_lifetimes from rustc_codegen_llvm 2021-12-16 14:43:32 -05:00
llvm_util.rs Auto merge of #91125 - eskarn:llvm-passes-plugin-support, r=nagisa 2021-12-30 02:53:09 +00:00
mono_item.rs Remove in_band_lifetimes from rustc_codegen_llvm 2021-12-16 14:43:32 -05:00
type_.rs Remove in_band_lifetimes from rustc_codegen_llvm 2021-12-16 14:43:32 -05:00
type_of.rs Fix clippy lints 2021-10-01 23:17:19 +02:00
va_arg.rs Remove in_band_lifetimes from rustc_codegen_llvm 2021-12-16 14:43:32 -05:00
value.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00