about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa
AgeCommit message (Collapse)AuthorLines
2023-10-20s/generator/coroutine/Oli Scherer-15/+15
2023-10-20s/Generator/Coroutine/Oli Scherer-10/+10
2023-10-18make `self_contained` return `LinkSelfContainedComponents`Rémy Rakic-50/+65
2023-10-18unify `LinkSelfContained` and `LinkSelfContainedDefault`Rémy Rakic-6/+6
Removes the backwards-compatible `LinkSelfContainedDefault`, by incorporating the remaining specifics into `LinkSelfContained`. Then renames the modern options to keep the old name.
2023-10-18limit `lld` flavors to the llvm backendRémy Rakic-2/+21
2023-10-18allow target specs to declare self-contained linking componentsRémy Rakic-9/+30
2023-10-17[RFC 3127 - Trim Paths]: Condition remapped filepath on remap scopesUrgau-1/+2
2023-10-15Auto merge of #116688 - compiler-errors:rustfmt-up, r=WaffleLapkin,Nilstriebbors-47/+103
Format all the let-chains in compiler crates Since rust-lang/rustfmt#5910 has landed, soon we will have support for formatting let-chains (as soon as rustfmt syncs and beta gets bumped). This PR applies the changes [from master rustfmt to rust-lang/rust eagerly](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/out.20formatting.20of.20prs/near/374997516), so that the next beta bump does not have to deal with a 200+ file diff and can remain concerned with other things like `cfg(bootstrap)` -- #113637 was a pain to land, for example, because of let-else. I will also add this commit to the ignore list after it has landed. The commands that were run -- I'm not great at bash-foo, but this applies rustfmt to every compiler crate, and then reverts the two crates that should probably be formatted out-of-tree. ``` ~/rustfmt $ ls -1d ~/rust/compiler/* | xargs -I@ cargo run --bin rustfmt -- `@/src/lib.rs` --config-path ~/rust --edition=2021 # format all of the compiler crates ~/rust $ git checkout HEAD -- compiler/rustc_codegen_{gcc,cranelift} # revert changes to cg-gcc and cg-clif ``` cc `@rust-lang/rustfmt` r? `@WaffleLapkin` or `@Nilstrieb` who said they may be able to review this purely mechanical PR :> cc `@Mark-Simulacrum` and `@petrochenkov,` who had some thoughts on the order of operations with big formatting changes in https://github.com/rust-lang/rust/pull/95262#issue-1178993801. I think the situation has changed since then, given that let-chains support exists on master rustfmt now, and I'm fairly confident that this formatting PR should land even if *bootstrap* rustfmt doesn't yet format let-chains in order to lessen the burden of the next beta bump.
2023-10-15Restore `#![no_builtins]` crates participation in LTO.DianQK-50/+6
After #113716, we can make `#![no_builtins]` crates participate in LTO again. `#![no_builtins]` with LTO does not result in undefined references to the error.
2023-10-14Auto merge of #116702 - durin42:compress-debuginfo, r=compiler-errorsbors-0/+9
linker: also pass debuginfo compression flags We support compressing debuginfo during codegen, but until this patch we didn't pass the flag to the linker. Doing so means we'll respect the requested compression even when building binaries or dylibs. This produces much smaller binaries: in my testing a debug build of ripgrep goes from 85M to 32M, and the target/ directory (after a clean build in both cases) goes from 508M to 329M just by enabling zlib compression of debuginfo.
2023-10-13linker: also pass debuginfo compression flagsAugie Fackler-0/+9
We support compressing debuginfo during codegen, but until this patch we didn't pass the flag to the linker. Doing so means we'll respect the requested compression even when building binaries or dylibs. This produces much smaller binaries: in my testing a debug build of ripgrep goes from 85M to 32M, and the target/ directory (after a clean build in both cases) goes from 508M to 329M just by enabling zlib compression of debuginfo.
2023-10-13Format all the let chains in compilerMichael Goulet-47/+103
2023-10-13Auto merge of #115964 - bjorn3:cgu_reuse_tracker_global_state, r=cjgillotbors-9/+399
Remove cgu_reuse_tracker from Session This removes a bit of global mutable state. It will now miss post-lto cgu reuse when ThinLTO determines that a cgu doesn't get changed, but there weren't any tests for this anyway and a test for it would be fragile to the exact implementation of ThinLTO in LLVM.
2023-10-11Auto merge of #116014 - lqd:mcp510-2-electric-boogaloo, r=petrochenkovbors-3/+4
Implement `-Clink-self-contained=-linker` opt out This implements the `-Clink-self-contained` opt out necessary to switch to lld by changing rustc's defaults instead of cargo's. Components that are enabled and disabled on the CLI are recorded, for the purpose of being merged with the ones which the target spec will declare (I'll open another PR for that tomorrow, for easier review). For MCP510, we now check whether using the self-contained linker is disabled on the CLI. Right now it would only be sensible to with `-Zgcc-ld=lld` (and I'll add some checks that we don't both enable and disable a component on the CLI in a future PR), but the goal is to simplify adding the check of the target's enabled components here in the follow-up PRs. r? `@petrochenkov`
2023-10-11Stabilize Ratified RISC-V Target FeaturesGijs Burghoorn-20/+20
As shortly discussed on Zulip (https://rust-lang.zulipchat.com/#narrow/stream/250483-t-compiler.2Frisc-v/topic/Stabilization.20of.20RISC-V.20Target.20Features/near/394793704), this commit stabilizes the ratified RISC-V instruction bases and extensions. Specifically, this commit stabilizes the: * Atomic Instructions (A) on v2.0 * Compressed Instructions (C) on v2.0 * Integer Multiplication and Division (M) on v2.0 * Bit Manipulations (B) on v1.0 listed as `zba`, `zbc`, `zbs` * Scalar Cryptography (Zk) v1.0.1 listed as `zk`, `zkn`, `zknd`, `zkne`, `zknh`, `zkr`, `zks`, `zksed`, `zksh`, `zkt`, `zbkb`, `zbkc` `zkbx`
2023-10-09Fix review commentsbjorn3-4/+4
2023-10-09Remove interior mutability from CguReuseTrackerbjorn3-28/+15
2023-10-09Remove cgu_reuse_tracker from Sessionbjorn3-4/+411
This removes a bit of global mutable state
2023-10-09Remove an LTO dependent cgu_reuse_tracker.set_actual_reuse callbjorn3-4/+0
2023-10-09Reuse determine_cgu_reuse from cg_ssa in cg_clifbjorn3-1/+1
2023-10-08rustdoc: remove rust logo from non-Rust cratesMichael Howell-0/+3
2023-10-08implement opt out `-Clink-self-contained=-linker`Rémy Rakic-3/+4
record both enabled and disabled components so that they can be merged with the ones that the target spec will define
2023-10-08Auto merge of #116454 - tmiasko:small-dominators, r=cjgillotbors-16/+1
Generalize small dominators optimization * Use small dominators optimization from 640ede7b0a1840415cb6ec881c2210302bfeba18 more generally. * Merge `DefLocation` and `LocationExtended` since they serve the same purpose.
2023-10-08Auto merge of #116514 - petrochenkov:nogccld, r=lqdbors-22/+7
linker: Remove `-Zgcc-ld` option It is subsumed by `-Clinker-flavor=*-lld-cc -Clink-self-contained=+linker` options now. r? `@lqd`
2023-10-08linker: Remove `-Zgcc-ld` optionVadim Petrochenkov-22/+7
It is subsumed by `-Clinker-flavor=*-lld-cc -Clink-self-contained=+linker` options now
2023-10-08Auto merge of #116487 - tamird:avoid-unwrap-absolute, r=bjorn3bors-8/+6
compiler: env/path handling fixes Please see individual commits. r? `@bjorn3` cf. #116426
2023-10-06Rollup merge of #116277 - RalfJung:post-mono, r=oli-obkJubilee-11/+6
dont call mir.post_mono_checks in codegen It seems like all tests are still passing when I remove this... let's see what CI says.
2023-10-06add some comments explaining how the required_consts stuff fits togetherRalf Jung-0/+6
2023-10-06Fix sdkname for tvos simulatorSebastian Imlay-0/+1
2023-10-06rustc_codegen_ssa: use try_canonicalize in rpathTamir Duberstein-8/+6
This is simpler and avoids unnecessary calls to `env::current_dir`.
2023-10-05Move DefLocation from rustc_codegen_ssa to rustc_middleTomasz Miąsko-16/+1
2023-10-05Rollup merge of #116223 - catandcoder:master, r=cjgillotJubilee-1/+1
Fix misuses of a vs an Fixes the misuse of "a" vs "an", according to English grammatical expectations and using https://www.a-or-an.com/
2023-10-04Fix misuses of a vs ancui fliter-1/+1
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-10-03Auto merge of #115025 - ouz-a:ouz_testing, r=lcnrbors-0/+1
Make subtyping explicit in MIR This adds new mir-opt that pushes new `ProjectionElem` called `ProjectionElem::Subtype(T)` to `Rvalue` of a subtyped assignment so we can unsoundness issues like https://github.com/rust-lang/rust/issues/107205 Addresses https://github.com/rust-lang/rust/issues/112651 r? `@lcnr`
2023-10-02Add docs, remove code, change subtyper codeouz-a-1/+1
2023-10-02subtyping_projectionsouz-a-0/+1
2023-10-02Reapply: Mark drop calls in landing pads cold instead of noinlineErik Desjardins-8/+4
Co-authored-by: Max Fan <git@max.fan> Co-authored-by: Nikita Popov <npopov@redhat.com>
2023-09-30dont call mir.post_mono_checks in codegenRalf Jung-11/+0
2023-09-29Auto merge of #113301 - Be-ing:stabilize_bundle_whole-archive, r=petrochenkovbors-15/+1
stabilize combining +bundle and +whole-archive link modifiers Per discussion on https://github.com/rust-lang/rust/issues/108081 combining +bundle and +whole-archive already works and can be stabilized independently of other aspects of the packed_bundled_libs feature. There is no risk of regression because this was not previously allowed. r? `@petrochenkov`
2023-09-28Strip `OpaqueCast` during `RevealAll`.Oli Scherer-1/+3
2023-09-27fix clippy::{redundant_guards, useless_format}Matthias Krüger-1/+1
2023-09-26Auto merge of #116144 - lcnr:subst-less, r=oli-obkbors-1/+1
subst -> instantiate continues #110793, there are still quite a few uses of `subst` and `substitute`, but changing them all in the same PR was a bit too much, so I've stopped here for now.
2023-09-26Auto merge of #116102 - cjgillot:indirect-scalar, r=oli-obkbors-12/+11
Correct codegen of `ConstValue::Indirect` scalar and scalar pair This concerns 3 tricky cases with `ConstValue::Indirect`: - if we want a non-pointer scalar; - if we have non-zero offset; - if offset points to uninit memory => generate `poison` instead of an ICE. This case could happen in unreachable code, trying to extract a field from the wrong variant. Those cases are not currently emitted by the compiler, but are exercised by https://github.com/rust-lang/rust/pull/116012.
2023-09-26subst -> instantiatelcnr-1/+1
2023-09-25Pass name of object file to LLVM so it can correctly emit S_OBJNAMEFlorian Schmiderer-1/+8
2023-09-24Auto merge of #105861 - Ayush1325:uefi-std-minimial, r=workingjubileebors-6/+22
Add Minimal Std implementation for UEFI # Implemented modules: 1. alloc 2. os_str 3. env 4. math # Related Links Tracking Issue: https://github.com/rust-lang/rust/issues/100499 API Change Proposal: https://github.com/rust-lang/libs-team/issues/87 # Additional Information This was originally part of https://github.com/rust-lang/rust/pull/100316. Since that PR was becoming too unwieldy and cluttered, and with suggestion from `@dvdhrm,` I have extracted a minimal std implementation to this PR. The example in `src/doc/rustc/src/platform-support/unknown-uefi.md` has been tested for `x86_64-unknown-uefi` and `i686-unknown-uefi` in OVMF. It would be great if someone more familiar with AARCH64 can help with testing for that target. Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2023-09-24Rollup merge of #116104 - cjgillot:calculate_debuginfo_offset, r=b-naberMatthias Krüger-33/+10
Reuse calculate_debuginfo_offset for fragments. This removes a little code duplication.
2023-09-23Use correct offset when codegening mir::Const::Indirect.Camille GILLOT-12/+11
2023-09-23Tolerate non-ptr indirect scalars in codegen.Camille GILLOT-1/+1
2023-09-23Reuse calculate_debuginfo_offset for fragments.Camille GILLOT-33/+10