about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa
AgeCommit message (Collapse)AuthorLines
2022-05-02Auto merge of #96436 - petrochenkov:nowhole2, r=wesleywiserbors-44/+8
linker: Stop using whole-archive on dependencies of dylibs https://github.com/rust-lang/rust/pull/95604 implemented a better and more fine-grained way of keeping exported symbols alive. Addresses the second question from https://github.com/rust-lang/rust/pull/93901#issuecomment-1041325522. r? `@wesleywiser`
2022-05-01Use reverse postorder in `non_ssa_locals`Tomasz Miąsko-2/+2
The reverse postorder, unlike preorder, is now cached inside the MIR body. Code generation uses reverse postorder anyway, so it might be a small perf improvement to use it here as well.
2022-04-30Merge new_metadata into codegen_allocatorbjorn3-15/+4
2022-04-30Remove config parameter of optimize_fat and avoid interior mutability for modulebjorn3-5/+3
2022-04-30Let LtoModuleCodegen::optimize take self by valuebjorn3-9/+8
2022-04-30Rename run_lto_pass_manager to optimize_fat and remove thin parameterbjorn3-6/+5
2022-04-30Auto merge of #96500 - SparrowLii:rpo, r=tmiaskobors-1/+0
Reduce duplication of RPO calculation of mir Computing the RPO of mir is not a low-cost thing, but it is duplicate in many places. In particular the `iterate_to_fixpoint` method which is called multiple times when computing the data flow. This PR reduces the number of times the RPO is recalculated as much as possible, which should save some compile time.
2022-04-30Eliminate duplication of RPO calculation for mirSparrowLii-1/+0
add `postorder_cache` to mir Body add `ReversePostorderCache` struct correct struct name and comments
2022-04-29Auto merge of #96474 - SparrowLii:langcall, r=lcnrbors-29/+14
Eliminate duplication code of building panic langcall during codegen From the FIXME in the `codegen_panic_intrinsic` func.
2022-04-29Rollup merge of #96523 - nbdd0121:windows, r=petrochenkovDylan DPC-0/+23
Add `@feat.00` symbol to symbols.o for COFF Fix #96498 This is based on top of #96444. r? ``@petrochenkov``
2022-04-29Auto merge of #96444 - nbdd0121:used2, r=petrochenkovbors-2/+77
Use decorated names for linked_symbols on Windows Fix #96423 r? `@petrochenkov`
2022-04-28Add `@feat.00` symbol to symbols.o for COFFGary Guo-0/+23
2022-04-28use tcx.require_lang_item() insteadSparrowLii-12/+5
2022-04-28Rollup merge of #96432 - SparrowLii:dbg_scope, r=davidtwcoDylan DPC-9/+3
not need `Option` for `dbg_scope` This PR fixes a few FIXME about not using `Option` in `dbg_scope` field of `DebugScope`, during `create_function_debug_context` func in codegen parts. Added a `BitSet<SourceScope>` parameter to `make_mir_scope` to indicate whether the `DebugScope` has been instantiated. cc ````@eddyb````
2022-04-27Use decorated names for linked_symbols on WindowsGary Guo-2/+77
2022-04-27Eliminate duplication of building panic langcall in codegenSparrowLii-24/+16
2022-04-26linker: Generate `symbols.o` for dylibsVadim Petrochenkov-2/+2
2022-04-26linker: Stop using whole-archive on dependencies of dylibsVadim Petrochenkov-42/+6
https://github.com/rust-lang/rust/pull/95604 implemented a better and more fine-grained way of keeping exported symbols alive.
2022-04-26not need `Option` for `dbg_scope`SparrowLii-9/+3
2022-04-25Auto merge of #95604 - nbdd0121:used2, r=petrochenkovbors-56/+240
Generate synthetic object file to ensure all exported and used symbols participate in the linking Fix #50007 and #47384 This is the synthetic object file approach that I described in https://github.com/rust-lang/rust/pull/95363#issuecomment-1079932354, allowing all exported and used symbols to be linked while still allowing them to be GCed. Related #93791, #95363 r? `@petrochenkov` cc `@carbotaniuman`
2022-04-25Stop exporting rust_eh_personality and friends from cdylibGary Guo-15/+9
2022-04-24Fix MSVC hang issueGary Guo-0/+6
2022-04-21Auto merge of #95612 - davidtwco:split-debuginfo-in-bootstrap, r=Mark-Simulacrumbors-1/+1
bootstrap: add split-debuginfo config Replace `run-dysutil` option with more general `split-debuginfo` option that works on all platforms. r? `@Mark-Simulacrum`
2022-04-19Rollup merge of #96142 - cjgillot:no-crate-def-index, r=petrochenkovDylan DPC-15/+2
Stop using CRATE_DEF_INDEX outside of metadata encoding. `CRATE_DEF_ID` and `CrateNum::as_def_id` are almost always what we want. We should not manipulate raw `DefIndex` outside of metadata encoding.
2022-04-18Conditionally export msan symbols only if they are definedGary Guo-2/+10
* `__msan_keep_going` is defined when `-Zsanitizer-recover=memory`. * `__msan_track_origins` is defined when `-Zsanitizer-memory-track-origins`.
2022-04-18Refactor exported_symbols and linked_symbols for code reuseGary Guo-44/+26
2022-04-18Synthesis object file for `#[used]` and exported symbolsGary Guo-8/+172
2022-04-18Add `SymbolExportInfo`Gary Guo-21/+51
This is currently a wrapper to `SymbolExportLevel` but it allows later addition of extra information.
2022-04-18ssa: don't pack debuginfo on windows not only msvcDavid Wood-1/+1
Small fix that prevents `thorin` from running on platforms where it definitely shouldn't be running. Signed-off-by: David Wood <david.wood@huawei.com>
2022-04-17Stop using CRATE_DEF_INDEX.Camille GILLOT-15/+2
`CRATE_DEF_ID` and `CrateNum::as_def_id` are almost always what we want.
2022-04-17Auto merge of #96010 - eduardosm:Unique-on-top-of-NonNull, r=m-ou-se,tmiaskobors-2/+6
Implement `core::ptr::Unique` on top of `NonNull` Removes the use `rustc_layout_scalar_valid_range_start` and some `unsafe` blocks.
2022-04-15Add codegen for global_asm! sym operandsAmanieu d'Antras-6/+30
2022-04-14Add additional `extract_field` / `project_field` to take into account extra ↵Eduardo Sánchez Muñoz-2/+6
level of struct nesting.
2022-04-13Auto merge of #95968 - davidtwco:translation-lazy-fallback, r=oli-obkbors-1/+1
errors: lazily load fallback fluent bundle Addresses (hopefully) https://github.com/rust-lang/rust/pull/95667#issuecomment-1094794087. Loading the fallback bundle in compilation sessions that won't go on to emit any errors unnecessarily degrades compile time performance, so lazily create the Fluent bundle when it is first required. r? `@ghost` (just for perf initially)
2022-04-13Auto merge of #95656 - cjgillot:no-id-hashing-mode, r=Aaron1011bors-6/+1
Remove NodeIdHashingMode. r? `@ghost`
2022-04-13errors: lazily load fallback fluent bundleDavid Wood-1/+1
Loading the fallback bundle in compilation sessions that won't go on to emit any errors unnecessarily degrades compile time performance, so lazily create the Fluent bundle when it is first required. Signed-off-by: David Wood <david.wood@huawei.com>
2022-04-12Remove NodeIdHashingMode.Camille GILLOT-6/+1
2022-04-11Add new `MutatatingUseContext`s for deinit and `SetDiscriminant`Jakob Degen-0/+2
2022-04-11Add new `Deinit` statement kindJakob Degen-0/+6
2022-04-08check_doc_keyword: don't alloc string for emptiness checkklensy-4/+4
check_doc_alias_value: get argument as Symbol to prevent needless string convertions check_doc_attrs: don't alloc vec, iterate over slice. Vec introduced in #83149, but no perf run posted on merge replace as_str() check with symbol check get_single_str_from_tts: don't prealloc string trivial string to str replace LifetimeScopeForPath::NonElided use Vec<Symbol> instead of Vec<String> AssertModuleSource use BTreeSet<Symbol> instead of BTreeSet<String> CrateInfo.crate_name replace FxHashMap<CrateNum, String> with FxHashMap<CrateNum, Symbol>
2022-04-05Auto merge of #94527 - oli-obk:undef_scalars, r=nagisa,erikdesjardinbors-18/+23
Let CTFE to handle partially uninitialized unions without marking the entire value as uninitialized. follow up to #94411 To fix https://github.com/rust-lang/rust/issues/69488 and by extension fix https://github.com/rust-lang/rust/issues/94371, we should stop treating types like `MaybeUninit<usize>` as something that the `Scalar` type in the interpreter engine can represent. So we add a new field to `abi::Primitive` that records whether the primitive is nested in a union cc `@RalfJung` r? `@ghost`
2022-04-05Mark scalar layout unions so that backends that do not support partially ↵Oli Scherer-18/+23
initialized scalars can special case them.
2022-04-05errors: implement fallback diagnostic translationDavid Wood-5/+15
This commit updates the signatures of all diagnostic functions to accept types that can be converted into a `DiagnosticMessage`. This enables existing diagnostic calls to continue to work as before and Fluent identifiers to be provided. The `SessionDiagnostic` derive just generates normal diagnostic calls, so these APIs had to be modified to accept Fluent identifiers. In addition, loading of the "fallback" Fluent bundle, which contains the built-in English messages, has been implemented. Each diagnostic now has "arguments" which correspond to variables in the Fluent messages (necessary to render a Fluent message) but no API for adding arguments has been added yet. Therefore, diagnostics (that do not require interpolation) can be converted to use Fluent identifiers and will be output as before.
2022-04-05errors: introduce `DiagnosticMessage`David Wood-2/+2
Introduce a `DiagnosticMessage` type that will enable diagnostic messages to be simple strings or Fluent identifiers. `DiagnosticMessage` is now used in the implementation of the standard `DiagnosticBuilder` APIs. Signed-off-by: David Wood <david.wood@huawei.com>
2022-04-04Auto merge of #95606 - petrochenkov:linkregr, r=wesleywiserbors-1/+6
linker: Implicitly link native libs as whole-archive in some more cases Partially revert changes from https://github.com/rust-lang/rust/pull/93901 to address regressions like https://github.com/rust-lang/rust/issues/95561. Fixes https://github.com/rust-lang/rust/issues/95561 r? `@wesleywiser`
2022-04-03Cleanup after some refactoring in rustc_targetLoïc BRANSTETT-3/+3
2022-04-03Replace LinkArgs with Cow<'static, str>Loïc BRANSTETT-5/+6
2022-04-03Replace every Vec in Target(Options) with it's Cow equivalentLoïc BRANSTETT-2/+2
2022-04-03Replace every `String` in Target(Options) with `Cow<'static, str>`Loïc BRANSTETT-12/+12
2022-04-03Auto merge of #90791 - drmorr0:drmorr-memcmp-cint-cfg, r=petrochenkovbors-0/+1
make memcmp return a value of c_int_width instead of i32 This is an attempt to fix #32610 and #78022, namely, that `memcmp` always returns an `i32` regardless of the platform. I'm running into some issues and was hoping I could get some help. Here's what I've been attempting so far: 1. Build the stage0 compiler with all the changes _expect_ for the changes in `library/core/src/slice/cmp.rs` and `compiler/rustc_codegen_llvm/src/context.rs`; this is because `target_c_int_width` isn't passed through and recognized as a valid config option yet. I'm building with `./x.py build --stage 0 library/core library/proc_macro compiler/rustc` 2. Next I add in the `#[cfg(c_int_width = ...)]` params to `cmp.rs` and `context.rs` and build the stage 1 compiler by running `./x.py build --keep-stage 0 --stage 1 library/core library/proc_macro compiler/rustc`. This step now runs successfully. 3. Lastly, I try to build the test program for AVR mentioned in #78022 with `RUSTFLAGS="--emit llvm-ir" cargo build --release`, and look at the resulting llvm IR, which still shows: ``` ... %11 = call addrspace(1) i32 `@memcmp(i8*` nonnull %5, i8* nonnull %10, i16 5) #7, !dbg !1191 %.not = icmp eq i32 %11, 0, !dbg !1191 ... ; Function Attrs: nounwind optsize declare i32 `@memcmp(i8*,` i8*, i16) local_unnamed_addr addrspace(1) #4 ``` Any ideas what I'm missing here? Alternately, if this is totally the wrong approach I'm open to other suggestions. cc `@Rahix`