about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src
AgeCommit message (Collapse)AuthorLines
2024-08-05Rollup merge of #128664 - fuzzypixelz:add-codegen-ssa-debug-impls, r=lcnrMatthias Krüger-6/+6
Add `Debug` impls to API types in `rustc_codegen_ssa` Some types used in `rustc_codegen_ssa`'s interface traits are missing `Debug` impls. Though I did not smear `#[derive(Debug)]` all over the crate (some structs are quite large).
2024-08-05`OperandRef` already had a `Debug` implMahmoud Mazouz-1/+1
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
2024-08-04Add `Debug` impls to API types in `rustc_codegen_ssa`Mahmoud Mazouz-7/+7
2024-08-04Implement a implicit target feature mechanismdaxpedda-0/+8
2024-08-03Auto merge of #128370 - petrochenkov:libsearch, r=bjorn3bors-38/+60
linker: Pass fewer search directories to the linker - The logic for passing `-L` directories to the linker is consolidated in a single function, so the search priorities are immediately clear. - Only `-Lnative=`, `-Lframework=` `-Lall=` directories are passed to linker, but not `-Lcrate=` and others. That's because only native libraries are looked up by name by linker, all Rust crates are passed using full paths, and their directories should not interfere with linker search paths. - The main sysroot library directory shouldn't generally be passed because it shouldn't contain native libraries, except for one case which is now marked with a FIXME. - This also helps with https://github.com/rust-lang/rust/pull/123436, in which we need to walk the same list of directories manually. The next step is to migrate `find_native_static_library` to exactly the same set and order of search directories (which may be a bit annoying for the `iOSSupport` directories https://github.com/rust-lang/rust/pull/121430#issuecomment-2256372341).
2024-08-03Fix linking to sanitizers on Apple targetsVadim Petrochenkov-3/+7
2024-08-03linker: Pass fewer search directories to the linkerVadim Petrochenkov-38/+56
2024-08-02Add the `sha512`, `sm3` and `sm4` target featuressayantn-0/+1
Add the feature in `core/lib.rs`
2024-08-01Rollup merge of #128450 - dpaoliello:coff, r=bjorn3Matthias Krüger-5/+1
Create COFF archives for non-LLVM backends `ar_archive_writer` now supports creating COFF archives, so enable them for the non-LLVM backends when requested. r? ``@bjorn3``
2024-07-31Create COFF archives for non-LLVM backendsDaniel Paoliello-5/+1
2024-07-31Rollup merge of #127830 - tgross35:archive-failure-message, r=BoxyUwUMatthias Krüger-2/+7
When an archive fails to build, print the path Currently the output on failure is as follows: Compiling block-buffer v0.10.4 Compiling crypto-common v0.1.6 Compiling digest v0.10.7 Compiling sha2 v0.10.8 Compiling xz2 v0.1.7 error: failed to build archive: No such file or directory error: could not compile `bootstrap` (lib) due to 1 previous error Change this to print which file is being constructed, to give some hint about what is going on. error: failed to build archive at `path/to/output`: No such file or directory
2024-07-30linker: Remove the "`--whole-archive` in test mode" backcompat hackVadim Petrochenkov-10/+1
2024-07-30Move mingw dlltool invocation to cg_ssabjorn3-0/+149
2024-07-30Move computation of decorated names out of the create_dll_import_lib methodbjorn3-4/+20
2024-07-30Move is_mingw_gnu_toolchain and i686_decorated_name to cg_ssabjorn3-0/+65
2024-07-30Move temp file name generation out of the create_dll_import_lib methodbjorn3-6/+9
2024-07-30Introduce create_dll_import_libs functionbjorn3-31/+44
2024-07-29Reformat `use` declarations.Nicholas Nethercote-292/+272
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-28Rollup merge of #127860 - klensy:dedup, r=Mark-SimulacrumGuillaume Gomez-15/+17
deps: dedup object, wasmparser, wasm-encoder * dedups one `object`, additional dupe will be removed, with next `thorin-dwp` update * `wasmparser` pinned to minor versions, so full merge isn't possible * same with `wasm-encoder` Turned off some features for `wasmparser` (see features https://github.com/bytecodealliance/wasm-tools/blob/v1.208.1/crates/wasmparser/Cargo.toml) in `run-make-support`, looks working?
2024-07-28adopt object changesklensy-15/+17
adopt wasm_encoder changes
2024-07-27Auto merge of #124905 - reitermarkus:u32-from-char-opt, r=scottmcmbors-57/+79
Allow optimizing `u32::from::<char>`. Extracted from https://github.com/rust-lang/rust/pull/124307. This allows optimizing the panicking branch in the `escape_unicode` function, see https://rust.godbolt.org/z/61YhKrhvP.
2024-07-25LLVM: LLVM-20.0 removes MMX typesMatthew Maurer-1/+0
See llvm/llvm-project#98505
2024-07-25Auto merge of #127995 - workingjubilee:say-turings-prayer, r=BoxyUwUbors-32/+30
compiler: Never debug_assert in codegen In the name of Turing and his Hoarey heralds, assert our truths before creating a monster! The `rustc_codegen_llvm` and `rustc_codegen_ssa` crates are fairly critical for rustc's correctness. Small mistakes here can easily result in undefined behavior, since a "small mistake" can mean something like "link and execute the wrong code". We should probably run any and all asserts in these modules unconditionally on whether this is a "debug build", and damn the costs in performance. ...Especially because the costs in performance seem to be *nothing*. It is not clear how much correctness we gain here, but I'll take free correctness improvements.
2024-07-22Rollup merge of #127506 - liushuyu:s390x-target-features, r=davidtwcoTrevor Gross-0/+1
rustc_target: add known safe s390x target features This pull request adds known safe target features for s390x (aka IBM Z systems). Currently, these features are unstable since stabilizing the target features requires submitting proposals. The `vector` feature was added in IBM Z13 (`arch11`), and this is a SIMD feature for the newer IBM Z systems. The `backchain` attribute is the IBM Z way of adding frame pointers like unwinding capabilities (the "frame-pointer" switch on IBM Z and IBM POWER platforms will add _emulated_ frame pointers to the binary, which profilers can't use for unwinding the stack). Both attributes can be applied at the LLVM module or function levels. However, the `backchain` attribute has to be enabled for all the functions in the call stack to get a successful unwind process.
2024-07-21Clarify when `None` is returned in `cast_immediate` function.Markus Reiter-0/+2
2024-07-21Remove unneeded assumption.Markus Reiter-1/+0
2024-07-21Allow optimizing `u32::from::<char>`.Markus Reiter-57/+78
2024-07-20Rollup merge of #127779 - momvart:should_codegen_hook, r=cjgillotMatthias Krüger-2/+29
Add a hook for `should_codegen_locally` This PR lifts the module-local function `should_codegen_locally` to `TyCtxt` as a hook. In addition to monomorphization, this function is used for checking the dependency of `compiler_builtins` on other libraries. Moving this function to the hooks also makes overriding it possible for the tools that use the rustc interface.
2024-07-20compiler: Never debug_assert in codegenJubilee Young-32/+30
The gains in performance are not worth the costs in correctness. This is partly because the gains are zero and the costs are unknown.
2024-07-19Avoid ref when using format! in compilerYuri Astrakhan-9/+9
Clean up a few minor refs in `format!` macro, as it has a performance cost. Apparently the compiler is unable to inline `format!("{}", &variable)`, and does a run-time double-reference instead (format macro already does one level referencing). Inlining format args prevents accidental `&` misuse.
2024-07-18valtree construction: keep track of which type was valtree-incompatibleRalf Jung-2/+3
2024-07-16Rollup merge of #127512 - eggyal:newline-terminate-print-linkargs, ↵Trevor Gross-1/+1
r=compiler-errors Terminate `--print link-args` output with newline Fixes #127507
2024-07-17rustc_codegen_ssa: add s390x_target_feature symbolliushuyu-0/+1
2024-07-16Rollup merge of #124033 - bjorn3:ar_archive_writer_0_3_0, r=davidtwcoTrevor Gross-13/+12
Sync ar_archive_writer to LLVM 18.1.3 From LLVM 15.0.0-rc3. This adds support for COFF archives containing Arm64EC object files and has various fixes for AIX big archive files.
2024-07-16When an archive fails to build, print the pathTrevor Gross-2/+7
Currently the output on failure is as follows: Compiling block-buffer v0.10.4 Compiling crypto-common v0.1.6 Compiling digest v0.10.7 Compiling sha2 v0.10.8 Compiling xz2 v0.1.7 error: failed to build archive: No such file or directory error: could not compile `bootstrap` (lib) due to 1 previous error Print which file is being constructed to give some hint about what is going on.
2024-07-16Fix unsafe_op_in_unsafe_fn in compilerMichael Goulet-1/+1
2024-07-15Move compiler_builtin check to the use caseMohammad Omidvar-2/+29
2024-07-13Rollup merge of #127434 - onur-ozkan:use-bootstrap-instead-of-rustbuild, ↵Jubilee-1/+1
r=Mark-Simulacrum use "bootstrap" instead of "rustbuild" in comments and docs Let's stick with the single name "bootstrap" to refer to the bootstrap project to avoid confusion. This should make it clearer, especially for new contributors.
2024-07-12Added the `xop` target feature and `xop_target_feature` gatesayantn-0/+1
2024-07-11Add the feature gate and target-featuressayantn-0/+1
2024-07-09Terminate `--print link-args` output with newlineAlan Egerton-1/+1
2024-07-07Fix review commentsbjorn3-1/+1
2024-07-07Sync ar_archive_writer to LLVM 18.1.3bjorn3-13/+12
From LLVM 15.0.0-rc3. This adds support for COFF archives containing Arm64EC object files and has various fixes for AIX big archive files.
2024-07-07Support tail calls in mir via `TerminatorKind::TailCall`Maybe Waffle-0/+8
2024-07-07use "bootstrap" instead of "rustbuild" in comments and docsonur-ozkan-1/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-03Auto merge of #126094 - petrochenkov:libsearch, r=michaelwoeristerbors-85/+94
linker: Link dylib crates by path Linkers seem to support linking dynamic libraries by path. Not sure why the previous scheme with splitting the path into a directory (passed with `-L`) and a name (passed with `-l`) was used (upd: likely due to https://github.com/rust-lang/rust/pull/126094#issuecomment-2155063414). When we split a library path `some/dir/libfoo.so` into `-L some/dir` and `-l foo` we add `some/dir` to search directories for *all* libraries looked up by the linker, not just `foo`, and `foo` is also looked up in *all* search directories not just `some/dir`. Technically we may find some unintended libraries this way. Therefore linking dylibs via a full path is both simpler and more reliable. It also makes the set of search directories more easily reproducible when we need to lookup some native library manually (like in https://github.com/rust-lang/rust/pull/123436).
2024-07-03Auto merge of #125507 - compiler-errors:type-length-limit, r=lcnrbors-1/+3
Re-implement a type-size based limit r? lcnr This PR reintroduces the type length limit added in #37789, which was accidentally made practically useless by the caching changes to `Ty::walk` in #72412, which caused the `walk` function to no longer walk over identical elements. Hitting this length limit is not fatal unless we are in codegen -- so it shouldn't affect passes like the mir inliner which creates potentially very large types (which we observed, for example, when the new trait solver compiles `itertools` in `--release` mode). This also increases the type length limit from `1048576 == 2 ** 20` to `2 ** 24`, which covers all of the code that can be reached with craterbot-check. Individual crates can increase the length limit further if desired. Perf regression is mild and I think we should accept it -- reinstating this limit is important for the new trait solver and to make sure we don't accidentally hit more type-size related regressions in the future. Fixes #125460
2024-07-02Fix spansMichael Goulet-3/+3
2024-07-02Give Instance::expect_resolve a spanMichael Goulet-0/+2
2024-07-02Rollup merge of #127230 - hattizai:patch01, r=saethlinMatthias Krüger-1/+1
chore: remove duplicate words remove duplicate words in comments to improve readability.