rust/compiler/rustc_codegen_ssa/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_ssa 2021-12-15 00:41:41 -05:00
debuginfo Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
mir Store a DefId instead of an AdtDef in AggregateKind::Adt 2021-12-22 14:36:34 -05:00
traits Rollup merge of #91885 - LegionMammal978:less-inband-codegen_ssa, r=workingjubilee 2021-12-15 10:56:59 +01:00
base.rs Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
common.rs Remove redundant [..]s 2021-12-09 00:01:29 +01:00
glue.rs Attach range metadata to alignment loads from vtables 2021-12-05 16:07:27 -05:00
lib.rs Remove in_band_lifetimes from rustc_codegen_ssa 2021-12-15 00:41:41 -05:00
meth.rs Auto merge of #89597 - michaelwoerister:improve-vtable-debuginfo, r=wesleywiser 2021-10-11 04:31:47 +00:00
mono_item.rs rustc_target: move LayoutOf to ty::layout. 2021-09-02 01:17:14 +03:00
target_features.rs asm: Allow using r9 (ARM) and x18 (AArch64) if they are not reserved by 2021-12-10 00:51:39 +00:00