rust/compiler
bors c38b8a8c62 Auto merge of #94579 - tmiasko:target-features, r=nagisa
Always include global target features in function attributes

This ensures that information about target features configured with
`-C target-feature=...` or detected with `-C target-cpu=native` is
retained for subsequent consumers of LLVM bitcode.

This is crucial for linker plugin LTO, since this information is not
conveyed to the plugin otherwise.

<details><summary>Additional test case demonstrating the issue</summary>

```rust
extern crate core;

#[inline]
#[target_feature(enable = "aes")]
unsafe fn f(a: u128, b: u128) -> u128 {
    use core::arch::x86_64::*;
    use core::mem::transmute;
    transmute(_mm_aesenc_si128(transmute(a), transmute(b)))
}

pub fn g(a: u128, b: u128) -> u128 {
    unsafe { f(a, b) }
}

fn main() {
    let mut args = std::env::args();
    let _ = args.next().unwrap();
    let a: u128 = args.next().unwrap().parse().unwrap();
    let b: u128 = args.next().unwrap().parse().unwrap();
    println!("{}", g(a, b));
}
```

```console
$ rustc --edition=2021 a.rs -Clinker-plugin-lto -Clink-arg=-fuse-ld=lld  -Ctarget-feature=+aes -O
...
  = note: LLVM ERROR: Cannot select: intrinsic %llvm.x86.aesni.aesenc
```

</details>

r? `@nagisa`
2022-03-06 18:07:11 +00:00
..
rustc
rustc_apfloat
rustc_arena
rustc_ast Ignore 2022-03-05 21:20:12 -05:00
rustc_ast_lowering Fallback to other where clause if preferred is missing 2022-03-05 13:15:00 -05:00
rustc_ast_passes Rollup merge of #94617 - pierwill:update-itertools, r=Mark-Simulacrum 2022-03-06 15:41:26 +01:00
rustc_ast_pretty Change syntax for TyAlias where clauses 2022-03-05 13:13:45 -05:00
rustc_attr Improve unexpected_cfgs lint when their is no value expected 2022-03-05 12:11:05 +01:00
rustc_borrowck Update itertools 2022-03-04 11:54:28 -06:00
rustc_builtin_macros Change syntax for TyAlias where clauses 2022-03-05 13:13:45 -05:00
rustc_codegen_cranelift
rustc_codegen_gcc all: fix some typos 2022-03-03 19:47:23 +08:00
rustc_codegen_llvm Always include global target features in function attributes 2022-03-04 16:57:34 +01:00
rustc_codegen_ssa Update itertools 2022-03-04 11:54:28 -06:00
rustc_const_eval Rollup merge of #94575 - RalfJung:switchint-comment, r=oli-obk 2022-03-04 02:06:43 +01:00
rustc_data_structures Auto merge of #94579 - tmiasko:target-features, r=nagisa 2022-03-06 18:07:11 +00:00
rustc_driver Rollup merge of #93913 - bjorn3:remove_everybody_loops, r=jackh726 2022-03-04 02:06:38 +01:00
rustc_error_codes Rollup merge of #94555 - cuishuang:master, r=oli-obk 2022-03-03 20:01:48 +01:00
rustc_errors Auto merge of #87835 - xFrednet:rfc-2383-expect-attribute-with-ids, r=wesleywiser 2022-03-03 18:59:32 +00:00
rustc_expand Auto merge of #94096 - cjgillot:ensure-stability, r=lcnr 2022-03-04 05:49:14 +00:00
rustc_feature Auto merge of #94096 - cjgillot:ensure-stability, r=lcnr 2022-03-04 05:49:14 +00:00
rustc_fs_util
rustc_graphviz
rustc_hir
rustc_hir_pretty
rustc_incremental all: fix some typos 2022-03-03 19:47:23 +08:00
rustc_index
rustc_infer Rollup merge of #94555 - cuishuang:master, r=oli-obk 2022-03-03 20:01:48 +01:00
rustc_interface Rollup merge of #94362 - Urgau:check-cfg-values, r=petrochenkov 2022-03-04 22:58:34 +01:00
rustc_lexer
rustc_lint Review changes 2022-03-05 13:15:00 -05:00
rustc_lint_defs Change to lint 2022-03-05 13:15:00 -05:00
rustc_llvm Remove build_helper 2022-03-05 15:31:22 +01:00
rustc_log
rustc_macros Make Ord, PartialOrd opt-out in newtype_index 2022-03-03 11:52:40 -06:00
rustc_metadata Rollup merge of #94057 - lcnr:simplify_type-uwu, r=nikomatsakis 2022-03-03 20:01:44 +01:00
rustc_middle Auto merge of #94570 - shampoofactory:reopen-91719, r=workingjubilee 2022-03-04 13:06:14 +00:00
rustc_mir_build
rustc_mir_dataflow
rustc_mir_transform Update itertools 2022-03-04 11:54:28 -06:00
rustc_monomorphize
rustc_parse Auto merge of #90076 - jackh726:wherethewhere, r=nikomatsakis 2022-03-06 07:22:09 +00:00
rustc_parse_format
rustc_passes Auto merge of #93142 - estebank:missing-main, r=wesleywiser 2022-03-05 02:46:24 +00:00
rustc_plugin_impl
rustc_privacy
rustc_query_impl
rustc_query_system
rustc_resolve Rollup merge of #94595 - TaKO8Ki:fix-invalid-unresolved-imports-errors-for-asterisk-wildcard-syntax, r=estebank 2022-03-04 22:58:35 +01:00
rustc_save_analysis
rustc_serialize
rustc_session Update -Z unpretty error message 2022-03-06 12:45:37 +00:00
rustc_span Rollup merge of #94362 - Urgau:check-cfg-values, r=petrochenkov 2022-03-04 22:58:34 +01:00
rustc_symbol_mangling
rustc_target Auto merge of #94601 - csmoe:android-asan, r=nagisa 2022-03-05 22:52:08 +00:00
rustc_trait_selection Rollup merge of #94057 - lcnr:simplify_type-uwu, r=nikomatsakis 2022-03-03 20:01:44 +01:00
rustc_traits
rustc_ty_utils
rustc_type_ir
rustc_typeck Rollup merge of #94460 - eholk:reenable-drop-tracking-tests, r=tmiasko 2022-03-05 04:46:37 +01:00