about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
AgeCommit message (Collapse)AuthorLines
2024-06-24Rollup merge of #124712 - Enselic:deprecate-inline-threshold, r=pnkfelixMichael Goulet-3/+0
Deprecate no-op codegen option `-Cinline-threshold=...` This deprecates `-Cinline-threshold` since using it has no effect. This has been the case since the new LLVM pass manager started being used, more than 2 years ago. Recommend using `-Cllvm-args=--inline-threshold=...` instead. Closes #89742 which is E-help-wanted.
2024-06-23compiler(nfc): -Cforce-frame-pointers is a FramePointerJubilee Young-2/+3
2024-06-22Rollup merge of #126555 - beetrees:f16-inline-asm-arm, r=AmanieuGuillaume Gomez-0/+39
Add `f16` inline ASM support for 32-bit ARM Adds `f16` inline ASM support for 32-bit ARM. SIMD vector types are taken from [here](https://developer.arm.com/architectures/instruction-sets/intrinsics/#f:`@navigationhierarchiesreturnbasetype=[float]&f:@navigationhierarchieselementbitsize=[16]&f:@navigationhierarchiesarchitectures=[A32]).` Relevant issue: #125398 Tracking issue: #116909 `@rustbot` label +F-f16_and_f128
2024-06-21Rollup merge of #126530 - beetrees:f16-inline-asm-riscv, r=AmanieuJubilee-6/+49
Add `f16` inline ASM support for RISC-V This PR adds `f16` inline ASM support for RISC-V. A `FIXME` is left for `f128` support as LLVM does not support the required `Q` (Quad-Precision Floating-Point) extension yet. Relevant issue: #125398 Tracking issue: #116909 `@rustbot` label +F-f16_and_f128
2024-06-21Add `f16` inline ASM support for RISC-Vbeetrees-6/+49
2024-06-21Add `f16` inline ASM support for 32-bit ARMbeetrees-0/+39
2024-06-18Remove redundant argument from `subdiagnostic` methodOli Scherer-1/+1
2024-06-18Use a dedicated type instead of a reference for the diagnostic contextOli Scherer-37/+41
This paves the way for tracking more state (e.g. error tainting) in the diagnostic context handle
2024-06-16Rollup merge of #126365 - Dirbaio:collapse-debuginfo-statics, r=workingjubilee许杰友 Jieyou Xu (Joe)-2/+2
Honor collapse_debuginfo for statics. fixes #126363 <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r​? <reviewer name> -->
2024-06-15Rollup merge of #126424 - Enselic:sort-target-features, r=lqdMatthias Krüger-0/+5
Also sort `crt-static` in `--print target-features` output I didn't find `crt-static` at first (for `x86_64-unknown-linux-gnu`), because it was put at the bottom of the large and otherwise sorted list. Fully sort the list before we print it. Note that `llvm_target_features` starts out and remains sorted and does not need to be sorted an extra time. On my machine the diff is just: ```diff $ diff -u /tmp/before2.txt /tmp/after2.txt --- /tmp/before2.txt 2024-06-13 20:40:27.091636592 +0200 +++ /tmp/after2.txt 2024-06-13 20:39:54.584894891 +0200 ``@@`` -20,6 +20,7 ``@@`` bmi1 - Support BMI instructions. bmi2 - Support BMI2 instructions. cmpxchg16b - 64-bit with cmpxchg16b (this is true for most x86-64 chips, but not the first AMD chips). + crt-static - Enables C Run-time Libraries to be statically linked. ermsb - REP MOVS/STOS are fast. f16c - Support 16-bit floating point conversion instructions. fma - Enable three-operand fused multiple-add. ``@@`` -49,7 +50,6 ``@@`` xsavec - Support xsavec instructions. xsaveopt - Support xsaveopt instructions. xsaves - Support xsaves instructions. - crt-static - Enables C Run-time Libraries to be statically linked. Code-generation features supported by LLVM for this target: 16bit-mode - 16-bit mode (i8086). ``` I couldn't find a ui test that tested this output. Let's see if CI finds a regression tests.
2024-06-14Deprecate no-op codegen option `-Cinline-threshold=...`Martin Nordholts-3/+0
This deprecates `-Cinline-threshold` since using it has no effect. This has been the case since the new LLVM pass manager started being used, more than 2 years ago.
2024-06-14Also sort `crt-static` in `--print target-features` outputMartin Nordholts-0/+5
I didn't find `crt-static` at first (for `x86_64-unknown-linux-gnu`), because it was put at the bottom the large and otherwise sorted list. Fully sort the list before we print it. Note that `llvm_target_features` starts out sorted and does not need to be sorted an extra time.
2024-06-13Add `f16` and `f128` inline ASM support for `x86` and `x86-64`beetrees-0/+100
2024-06-13Honor collapse_debuginfo for statics.Dario Nieuwenhuis-2/+2
fixes #126363
2024-06-12Rollup merge of #126324 - zmodem:loongarch, r=nikicMichael Goulet-0/+8
Adjust LoongArch64 data layouts for LLVM update The data layout was changed in LLVM 19: llvm/llvm-project#93814
2024-06-12Adjust LoongArch64 data layouts for LLVM updateHans Wennborg-0/+8
The data layout was changed in LLVM 19: llvm/llvm-project#93814
2024-06-12Use `tidy` to sort crate attributes for all compiler crates.Nicholas Nethercote-3/+5
We already do this for a number of crates, e.g. `rustc_middle`, `rustc_span`, `rustc_metadata`, `rustc_span`, `rustc_errors`. For the ones we don't, in many cases the attributes are a mess. - There is no consistency about order of attribute kinds (e.g. `allow`/`deny`/`feature`). - Within attribute kind groups (e.g. the `feature` attributes), sometimes the order is alphabetical, and sometimes there is no particular order. - Sometimes the attributes of a particular kind aren't even grouped all together, e.g. there might be a `feature`, then an `allow`, then another `feature`. This commit extends the existing sorting to all compiler crates, increasing consistency. If any new attribute line is added there is now only one place it can go -- no need for arbitrary decisions. Exceptions: - `rustc_log`, `rustc_next_trait_solver` and `rustc_type_ir_macros`, because they have no crate attributes. - `rustc_codegen_gcc`, because it's quasi-external to rustc (e.g. it's ignored in `rustfmt.toml`).
2024-06-10Rollup merge of #126159 - RalfJung:scalarint-size-mismatch, r=oli-obkMatthias Krüger-2/+2
ScalarInt: size mismatches are a bug, do not delay the panic Cc [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/Why.20are.20ScalarInt.20to.20iN.2FuN.20methods.20fallible.3F) r? ``@oli-obk``
2024-06-10ScalarInt: size mismatches are a bug, do not delay the panicRalf Jung-2/+2
2024-06-08simd packed types: update outdated check, extend codegen testRalf Jung-4/+6
2024-06-06Auto merge of #125406 - tbu-:pr_rm_path_with_extension, r=Nadrierilbors-7/+2
Directly add extension instead of using `Path::with_extension` `Path::with_extension` has a nice footgun when the original path doesn't contain an extension: Anything after the last dot gets removed.
2024-06-05Add `Ty` to `ConstKind::Value`Boxy-0/+1
2024-06-04Directly add extension instead of using `Path::with_extension`Tobias Bucher-7/+2
`Path::with_extension` has a nice footgun when the original path doesn't contain an extension: Anything after the last dot gets removed.
2024-06-02Rollup merge of #125311 - calebzulawski:repr-packed-simd-intrinsics, ↵Jubilee-1/+53
r=workingjubilee Make repr(packed) vectors work with SIMD intrinsics In #117116 I fixed `#[repr(packed, simd)]` by doing the expected thing and removing padding from the layout. This should be the last step in providing a solution to rust-lang/portable-simd#319
2024-06-01Improve documentationCaleb Zulawski-1/+6
2024-06-01Uplift TypeRelation and RelateMichael Goulet-4/+5
2024-05-30coverage: Rename MC/DC `conditions_num` to `num_conditions`Zalathar-3/+4
This value represents a quantity of conditions, not an ID, so the new spelling is more appropriate.
2024-05-29Rollup merge of #124655 - Darksonn:fixed-x18, r=lqd,estebankMatthias Krüger-1/+16
Add `-Zfixed-x18` This PR is a follow-up to #124323 that proposes a different implementation. Please read the description of that PR for motivation. See the equivalent flag in [the clang docs](https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-ffixed-x18). MCP: https://github.com/rust-lang/compiler-team/issues/748 Fixes https://github.com/rust-lang/rust/issues/121970 r? rust-lang/compiler
2024-05-24Auto merge of #125463 - GuillaumeGomez:rollup-287wx4y, r=GuillaumeGomezbors-8/+49
Rollup of 6 pull requests Successful merges: - #125263 (rust-lld: fallback to rustc's sysroot if there's no path to the linker in the target sysroot) - #125345 (rustc_codegen_llvm: add support for writing summary bitcode) - #125362 (Actually use TAIT instead of emulating it) - #125412 (Don't suggest adding the unexpected cfgs to the build-script it-self) - #125445 (Migrate `run-make/rustdoc-with-short-out-dir-option` to `rmake.rs`) - #125452 (Cleanup check-cfg handling in core and std) r? `@ghost` `@rustbot` modify labels: rollup
2024-05-23Rollup merge of #125345 - durin42:thin-link-bitcode, r=bjorn3Guillaume Gomez-8/+49
rustc_codegen_llvm: add support for writing summary bitcode Typical uses of ThinLTO don't have any use for this as a standalone file, but distributed ThinLTO uses this to make the linker phase more efficient. With clang you'd do something like `clang -flto=thin -fthin-link-bitcode=foo.indexing.o -c foo.c` and then get both foo.o (full of bitcode) and foo.indexing.o (just the summary or index part of the bitcode). That's then usable by a two-stage linking process that's more friendly to distributed build systems like bazel, which is why I'm working on this area. I talked some to `@teresajohnson` about naming in this area, as things seem to be a little confused between various blog posts and build systems. "bitcode index" and "bitcode summary" tend to be a little too ambiguous, and she tends to use "thin link bitcode" and "minimized bitcode" (which matches the descriptions in LLVM). Since the clang option is thin-link-bitcode, I went with that to try and not add a new spelling in the world. Per `@dtolnay,` you can work around the lack of this by using `lld --thinlto-index-only` to do the indexing on regular .o files of bitcode, but that is a bit wasteful on actions when we already have all the information in rustc and could just write out the matching minimized bitcode. I didn't test that at all in our infrastructure, because by the time I learned that I already had this patch largely written.
2024-05-23cleanup: run rustfmtAugie Fackler-11/+22
2024-05-23cleanup: standardize on summary over index in namesAugie Fackler-8/+8
I did this in the user-facing logic, but I noticed while fixing a minor defect that I had missed it in a few places in the internal details.
2024-05-23thinlto: only build summary file if neededAugie Fackler-10/+10
If we don't do this, some versions of LLVM (at least 17, experimentally) will double-emit some error messages, which is how I noticed this. Given that it seems to be costing some extra work, let's only request the summary bitcode production if we'll actually bother writing it down, otherwise skip it.
2024-05-23Remove `#[macro_use] extern crate tracing` from `rustc_codegen_llvm`.Nicholas Nethercote-4/+18
2024-05-22cleanup: remove leftover extra blockAugie Fackler-2/+0
This was needed in an older version of this patch, but never got edited out when it became obsolete.
2024-05-22rustc_codegen_llvm: add support for writing summary bitcodeAugie Fackler-5/+37
Typical uses of ThinLTO don't have any use for this as a standalone file, but distributed ThinLTO uses this to make the linker phase more efficient. With clang you'd do something like `clang -flto=thin -fthin-link-bitcode=foo.indexing.o -c foo.c` and then get both foo.o (full of bitcode) and foo.indexing.o (just the summary or index part of the bitcode). That's then usable by a two-stage linking process that's more friendly to distributed build systems like bazel, which is why I'm working on this area. I talked some to @teresajohnson about naming in this area, as things seem to be a little confused between various blog posts and build systems. "bitcode index" and "bitcode summary" tend to be a little too ambiguous, and she tends to use "thin link bitcode" and "minimized bitcode" (which matches the descriptions in LLVM). Since the clang option is thin-link-bitcode, I went with that to try and not add a new spelling in the world. Per @dtolnay, you can work around the lack of this by using `lld --thinlto-index-only` to do the indexing on regular .o files of bitcode, but that is a bit wasteful on actions when we already have all the information in rustc and could just write out the matching minimized bitcode. I didn't test that at all in our infrastructure, because by the time I learned that I already had this patch largely written.
2024-05-22Stop using `to_hir_binop` in codegenScott McMurray-6/+7
2024-05-21Rollup merge of #125266 - workingjubilee:stream-plastic-love, r=RalfJung,nikicMatthias Krüger-19/+29
compiler: add simd_ctpop intrinsic Fairly straightforward addition. cc `@rust-lang/opsem` new (extremely boring) intrinsic
2024-05-20Remove some `Path::to_str` from `rustc_codegen_llvm`Tobias Bucher-15/+14
Unnecessary panic paths when there's a better option.
2024-05-20Make repr(packed) vectors work with SIMD intrinsicsCaleb Zulawski-1/+48
2024-05-19clarify the second arg to llvm.ctlz and cttzJubilee Young-3/+3
2024-05-18compiler: add simd_ctpop intrinsicJubilee Young-19/+29
2024-05-17Rename Unsafe to SafetySantiago Pastorino-3/+3
2024-05-15Use an error struct instead of a panicAlice Ryhl-5/+10
2024-05-14Fail on non-aarch64 targetsAlice Ryhl-0/+5
2024-05-14coverage: `CoverageIdsInfo::mcdc_bitmap_bytes` is never neededZalathar-6/+1
This code for recalculating `mcdc_bitmap_bytes` doesn't provide any benefit, because its result won't have changed from the value in `FunctionCoverageInfo` that was computed during the MIR instrumentation pass.
2024-05-10Auto merge of #124972 - matthiaskrgr:rollup-3fablim, r=matthiaskrgrbors-28/+26
Rollup of 5 pull requests Successful merges: - #124615 (coverage: Further simplify extraction of mapping info from MIR) - #124778 (Fix parse error message for meta items) - #124797 (Refactor float `Primitive`s to a separate `Float` type) - #124888 (Migrate `run-make/rustdoc-output-path` to rmake) - #124957 (Make `Ty::builtin_deref` just return a `Ty`) r? `@ghost` `@rustbot` modify labels: rollup
2024-05-10Rollup merge of #124957 - compiler-errors:builtin-deref, r=michaelwoeristerMatthias Krüger-2/+2
Make `Ty::builtin_deref` just return a `Ty` Nowhere in the compiler are we using the mutability part of the `TyAndMut` that we used to return.
2024-05-10Rollup merge of #124797 - beetrees:primitive-float, r=davidtwcoMatthias Krüger-26/+24
Refactor float `Primitive`s to a separate `Float` type Now there are 4 of them, it makes sense to refactor `F16`, `F32`, `F64` and `F128` out of `Primitive` and into a separate `Float` type (like integers already are). This allows patterns like `F16 | F32 | F64 | F128` to be simplified into `Float(_)`, and is consistent with `ty::FloatTy`. As a side effect, this PR also makes the `Ty::primitive_size` method work with `f16` and `f128`. Tracking issue: #116909 `@rustbot` label +F-f16_and_f128
2024-05-10Auto merge of #124932 - RalfJung:temporal, r=compiler-errorsbors-0/+1
codegen: memmove/memset cannot be non-temporal non-temporal memset is not a thing. And for memmove, since the LLVM backend doesn't support this, surely we don't need it in the GCC backend.