diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-02-25 15:25:54 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-03-05 09:49:17 +1100 |
| commit | 936a8232df56cf6fbf41beb3b2329a99498d2167 (patch) | |
| tree | 648ed62694dab5ca4f5ec68e65e16c5f649fe83c /compiler/rustc_codegen_llvm/src/common.rs | |
| parent | 2df8e657f23cd56fe0f5f7e1a13697037a8a8487 (diff) | |
| download | rust-936a8232df56cf6fbf41beb3b2329a99498d2167.tar.gz rust-936a8232df56cf6fbf41beb3b2329a99498d2167.zip | |
Change signature of `target_features_cfg`.
Currently it is called twice, once with `allow_unstable` set to true and once with it set to false. This results in some duplicated work. Most notably, for the LLVM backend, `LLVMRustHasFeature` is called twice for every feature, and it's moderately slow. For very short running compilations on platforms with many features (e.g. a `check` build of hello-world on x86) this is a significant fraction of runtime. This commit changes `target_features_cfg` so it is only called once, and it now returns a pair of feature sets. This halves the number of `LLVMRustHasFeature` calls.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/common.rs')
0 files changed, 0 insertions, 0 deletions
