about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2023-08-11Auto merge of #2989 - eduardosm:x86-intrinsics, r=RalfJungbors-0/+1720
miri: implement some `llvm.x86.sse.*` intrinsics and add tests PR moved from https://github.com/rust-lang/rust/pull/113932. Implements LLVM intrisics needed to run most SSE functions from `core::arch::x86{,_64}`. Also adds miri tests for those functions (mostly copied from core_arch tests). r? `@RalfJung` The first commit is the same that the commit in the PR I had opened in the Rust repository. I addressed review comments in additional commits to make it easier to review. I also fixed formatting and clippy warnings.
2023-08-11Auto merge of #3023 - RalfJung:gamma, r=RalfJungbors-89/+1003
add gamma function shims needs a rustup to fetch the new declarations in std
2023-08-11miri: implement some `llvm.x86.sse.*` intrinsics and add testsEduardo Sánchez Muñoz-0/+1720
Implements LLVM intrisics needed to run most SSE functions from `core::arch::x86{,_64}`. Also adds miri tests for those functions (mostly copied from core_arch tests).
2023-08-11Auto merge of #113432 - klensy:ms-cut-backtrace, r=ChrisDentonbors-1/+1
reduce deps for windows-msvc targets for backtrace (eventually) mirrors https://github.com/rust-lang/backtrace-rs/pull/543 Some dependencies of backtrace don't used on windows-msvc targets, so exclude them: miniz_oxide (+ adler) addr2line (+ gimli) object (+ memchr) This saves about 30kb of std.dll + 17.5mb of rlibs
2023-08-11Merge commit '1e8fdf492808a25d78a97e1242b835ace9924e4d' into clippyupPhilipp Krones-378/+1543
2023-08-11rustc: Move `features` from `Session` to `GlobalCtxt`Vadim Petrochenkov-3/+3
Removes two pieces of mutable state. Follow up to #114622.
2023-08-11Auto merge of #114719 - compiler-errors:rollup-bf1vr51, r=compiler-errorsbors-205/+0
Rollup of 5 pull requests Successful merges: - #114194 (Inline trivial (noop) flush calls) - #114257 (Avoid using `ptr::Unique` in `LinkedList` code) - #114359 ([library/std] Replace condv while loop with `cvar.wait_while`.) - #114402 (Fix documentation of impl From<Vec<T>> for Rc<[T]>) - #114715 (Revert clippy lint [`filter_map_bool_then`]) r? `@ghost` `@rustbot` modify labels: rollup
2023-08-10Rollup merge of #114715 - Centri3:revert-clippy-11115, r=ManishearthMichael Goulet-205/+0
Revert clippy lint [`filter_map_bool_then`] r? `@Manishearth` Issue in question is https://github.com/rust-lang/rust-clippy/issues/11309. We usually wait until the next sync but this ICE is entirely unpreventable and happens often for code where type annotations are needed alongside a lifetime parameter so I think it's a good idea to revert it here. Also, this got into 1.71.1: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=620a95846a0e4810dffb39d7594d62d7
2023-08-10Rollup merge of #114622 - petrochenkov:noplugin, r=oli-obkMichael Goulet-2/+1
rustc: Move `crate_types` and `stable_crate_id` from `Session` to `GlobalCtxt` Removes two pieces of mutable state. Follow up to https://github.com/rust-lang/rust/pull/114578.
2023-08-10Revert "New lint [`filter_map_bool_then`]"Catherine Flores-205/+0
This reverts commits 978b1daf99d8326718684381704902fdaaf71b18 and 3235d9d612909bc64550eea3a0d387e1187e93dd.
2023-08-10add gamma function shimsRalf Jung-2/+42
2023-08-10Merge from rustcRalf Jung-86/+960
2023-08-10Preparing for merge from rustcRalf Jung-1/+1
2023-08-10replace AsAny hack by trait upcasting :)Ralf Jung-31/+22
2023-08-10Auto merge of #114697 - matthiaskrgr:rollup-ywooy8x, r=matthiaskrgrbors-4/+18
Rollup of 5 pull requests Successful merges: - #114278 (better error handling for `rust.codegen-backends` on deserialization) - #114674 (Add clubby789 to `users_on_vacation`) - #114678 (`Expr::can_have_side_effects()` is incorrect for struct/enum/array/tuple literals) - #114681 (doc (unstable-book): fix a typo) - #114684 (Remove redundant calls to `resolve_vars_with_obligations`) r? `@ghost` `@rustbot` modify labels: rollup
2023-08-10Stabilize thread local cell methods.Mara Bos-1/+0
2023-08-10Rollup merge of #114681 - zamazan4ik:master, r=compiler-errorsMatthias Krüger-1/+1
doc (unstable-book): fix a typo Just fix a small typo.
2023-08-10Rollup merge of #114278 - ozkanonur:validate-codegen-backend-config, r=clubby789Matthias Krüger-3/+17
better error handling for `rust.codegen-backends` on deserialization Fixes #109315
2023-08-10Auto merge of #112482 - tgross35:ci-non-rust-linters, r=pietroalbinibors-16/+681
Add support for tidy linting via external tools for non-rust files This change adds the flag `--check-extras` to `tidy`. It accepts a comma separated list of any of the options: * py (test everything applicable for python files) * py:lint (lint python files using `ruff`) * py:fmt (check formatting for python files using `black`) * shell or shell:lint (lint shell files using `shellcheck`) Specific files to check can also be specified via positional args. Examples: * `./x test tidy --check-extras=shell,py` * `./x test tidy --check-extras=py:fmt -- src/bootstrap/bootstrap.py` * `./x test tidy --check-extras=shell -- src/ci/*.sh` * Python formatting can be applied with bless: `./x test tidy --ckeck-extras=py:fmt --bless` `ruff` and `black` need to be installed via pip; this tool manages these within a virtual environment at `build/venv`. `shellcheck` needs to be installed on the system already. --- This PR doesn't fix any of the errors that show up (I will likely go through those at some point) and it doesn't enforce anything new in CI. Relevant zulip discussion: https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/Other.20linters.20in.20CI
2023-08-10Auto merge of #114001 - meysam81:issue-111894-fix, r=clubby789bors-46/+129
fix(bootstrap): rename exclude flag to skip 🐛 fixes #111894
2023-08-10Update profile_sample_use.mdAlexander Zaitsev-1/+1
Just remove a typo.
2023-08-09Rollup merge of #111891 - rustbox:feat/riscv-isr-cconv, r=jackh726Matthias Krüger-0/+2
feat: `riscv-interrupt-{m,s}` calling conventions Similar to prior support added for the mips430, avr, and x86 targets this change implements the rough equivalent of clang's [`__attribute__((interrupt))`][clang-attr] for riscv targets, enabling e.g. ```rust static mut CNT: usize = 0; pub extern "riscv-interrupt-m" fn isr_m() { unsafe { CNT += 1; } } ``` to produce highly effective assembly like: ```asm pub extern "riscv-interrupt-m" fn isr_m() { 420003a0: 1141 addi sp,sp,-16 unsafe { CNT += 1; 420003a2: c62a sw a0,12(sp) 420003a4: c42e sw a1,8(sp) 420003a6: 3fc80537 lui a0,0x3fc80 420003aa: 63c52583 lw a1,1596(a0) # 3fc8063c <_ZN12esp_riscv_rt3CNT17hcec3e3a214887d53E.0> 420003ae: 0585 addi a1,a1,1 420003b0: 62b52e23 sw a1,1596(a0) } } 420003b4: 4532 lw a0,12(sp) 420003b6: 45a2 lw a1,8(sp) 420003b8: 0141 addi sp,sp,16 420003ba: 30200073 mret ``` (disassembly via `riscv64-unknown-elf-objdump -C -S --disassemble ./esp32c3-hal/target/riscv32imc-unknown-none-elf/release/examples/gpio_interrupt`) This outcome is superior to hand-coded interrupt routines which, lacking visibility into any non-assembly body of the interrupt handler, have to be very conservative and save the [entire CPU state to the stack frame][full-frame-save]. By instead asking LLVM to only save the registers that it uses, we defer the decision to the tool with the best context: it can more accurately account for the cost of spills if it knows that every additional register used is already at the cost of an implicit spill. At the LLVM level, this is apparently [implemented by] marking every register as "[callee-save]," matching the semantics of an interrupt handler nicely (it has to leave the CPU state just as it found it after its `{m|s}ret`). This approach is not suitable for every interrupt handler, as it makes no attempt to e.g. save the state in a user-accessible stack frame. For a full discussion of those challenges and tradeoffs, please refer to [the interrupt calling conventions RFC][rfc]. Inside rustc, this implementation differs from prior art because LLVM does not expose the "all-saved" function flavor as a calling convention directly, instead preferring to use an attribute that allows for differentiating between "machine-mode" and "superivsor-mode" interrupts. Finally, some effort has been made to guide those who may not yet be aware of the differences between machine-mode and supervisor-mode interrupts as to why no `riscv-interrupt` calling convention is exposed through rustc, and similarly for why `riscv-interrupt-u` makes no appearance (as it would complicate future LLVM upgrades). [clang-attr]: https://clang.llvm.org/docs/AttributeReference.html#interrupt-risc-v [full-frame-save]: https://github.com/esp-rs/esp-riscv-rt/blob/9281af2ecffe13e40992917316f36920c26acaf3/src/lib.rs#L440-L469 [implemented by]: https://github.com/llvm/llvm-project/blob/b7fb2a3fec7c187d58a6d338ab512d9173bca987/llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp#L61-L67 [callee-save]: https://github.com/llvm/llvm-project/blob/973f1fe7a8591c7af148e573491ab68cc15b6ecf/llvm/lib/Target/RISCV/RISCVCallingConv.td#L30-L37 [rfc]: https://github.com/rust-lang/rfcs/pull/3246
2023-08-09Auto merge of #3021 - ttsugriy:bin-search, r=RalfJungbors-17/+6
Use Vec's binary search instead of hand-written one.
2023-08-09expand commentRalf Jung-0/+1
2023-08-09Use Vec's binary search instead of hand-written one.Taras Tsugrii-17/+5
2023-08-09Auto merge of #114649 - Kobzol:bolt-remove-use-old-text, r=nikicbors-1/+6
Remove usage of `--use-old-text` for BOLT This flag has [reduced](https://github.com/rust-lang/rust/pull/114141) the size of `libLLVM.so` by ~50 MiB, but sadly it is quite non-deterministic and the size savings frequently fail, thus causing large artifact size [swings](https://github.com/rust-lang/rust/pull/114297#issuecomment-1670292387). To avoid the swings, it would be better to just disable the flag for now. r? `@nikic`
2023-08-09Remove usage of `--use-old-text` for BOLTJakub Beránek-1/+6
2023-08-09rustc: Move `crate_types` from `Session` to `GlobalCtxt`Vadim Petrochenkov-2/+1
Removes a piece of mutable state. Follow up to #114578.
2023-08-09Rollup merge of #114634 - chriswailes:android-platform-doc-update, ↵Matthias Krüger-0/+2
r=Mark-Simulacrum Mention riscv64-linux-android support in Android documentation This CL brings the android.md file in-line with the list of supported targets from platform-support.md. Followup to https://github.com/rust-lang/rust/pull/112858 r? `@Mark-Simulacrum`
2023-08-08feat: `riscv-interrupt-{m,s}` calling conventionsSeth Pellegrino-0/+2
Similar to prior support added for the mips430, avr, and x86 targets this change implements the rough equivalent of clang's [`__attribute__((interrupt))`][clang-attr] for riscv targets, enabling e.g. ```rust static mut CNT: usize = 0; pub extern "riscv-interrupt-m" fn isr_m() { unsafe { CNT += 1; } } ``` to produce highly effective assembly like: ```asm pub extern "riscv-interrupt-m" fn isr_m() { 420003a0: 1141 addi sp,sp,-16 unsafe { CNT += 1; 420003a2: c62a sw a0,12(sp) 420003a4: c42e sw a1,8(sp) 420003a6: 3fc80537 lui a0,0x3fc80 420003aa: 63c52583 lw a1,1596(a0) # 3fc8063c <_ZN12esp_riscv_rt3CNT17hcec3e3a214887d53E.0> 420003ae: 0585 addi a1,a1,1 420003b0: 62b52e23 sw a1,1596(a0) } } 420003b4: 4532 lw a0,12(sp) 420003b6: 45a2 lw a1,8(sp) 420003b8: 0141 addi sp,sp,16 420003ba: 30200073 mret ``` (disassembly via `riscv64-unknown-elf-objdump -C -S --disassemble ./esp32c3-hal/target/riscv32imc-unknown-none-elf/release/examples/gpio_interrupt`) This outcome is superior to hand-coded interrupt routines which, lacking visibility into any non-assembly body of the interrupt handler, have to be very conservative and save the [entire CPU state to the stack frame][full-frame-save]. By instead asking LLVM to only save the registers that it uses, we defer the decision to the tool with the best context: it can more accurately account for the cost of spills if it knows that every additional register used is already at the cost of an implicit spill. At the LLVM level, this is apparently [implemented by] marking every register as "[callee-save]," matching the semantics of an interrupt handler nicely (it has to leave the CPU state just as it found it after its `{m|s}ret`). This approach is not suitable for every interrupt handler, as it makes no attempt to e.g. save the state in a user-accessible stack frame. For a full discussion of those challenges and tradeoffs, please refer to [the interrupt calling conventions RFC][rfc]. Inside rustc, this implementation differs from prior art because LLVM does not expose the "all-saved" function flavor as a calling convention directly, instead preferring to use an attribute that allows for differentiating between "machine-mode" and "superivsor-mode" interrupts. Finally, some effort has been made to guide those who may not yet be aware of the differences between machine-mode and supervisor-mode interrupts as to why no `riscv-interrupt` calling convention is exposed through rustc, and similarly for why `riscv-interrupt-u` makes no appearance (as it would complicate future LLVM upgrades). [clang-attr]: https://clang.llvm.org/docs/AttributeReference.html#interrupt-risc-v [full-frame-save]: https://github.com/esp-rs/esp-riscv-rt/blob/9281af2ecffe13e40992917316f36920c26acaf3/src/lib.rs#L440-L469 [implemented by]: https://github.com/llvm/llvm-project/blob/b7fb2a3fec7c187d58a6d338ab512d9173bca987/llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp#L61-L67 [callee-save]: https://github.com/llvm/llvm-project/blob/973f1fe7a8591c7af148e573491ab68cc15b6ecf/llvm/lib/Target/RISCV/RISCVCallingConv.td#L30-L37 [rfc]: https://github.com/rust-lang/rfcs/pull/3246
2023-08-08Rollup merge of #114615 - RalfJung:interpret-invalid-where, r=lcnrMatthias Krüger-1/+1
interpret: remove incomplete protection against invalid where clauses Cc https://github.com/rust-lang/rust/issues/97477, https://github.com/rust-lang/project-const-generics/issues/37 r? ``@lcnr``
2023-08-08Rollup merge of #114613 - ferrocene:pa-fix-rebuild, r=lqdMatthias Krüger-21/+36
Prevent constant rebuilds of `rustc-main` (and thus everything else) PR #114305 changed bootstrap to run `strip -g` on `librustc_driver.so` and `libllvm.so` on Linux when no debuginfo was requested. Unfortunately, that PR resulted in bootstrap always rebuilding everything starting from stage 1 `rustc-main` (including stage 1 libraries and tests) when invoking bootstrap multiple times. We noticed this because Ferrocene's CI times increased to between 2x and 3x total execution time, but the regression can also be reproduced locally by running `./x build library/sysroot --stage 1` twice. The explanation of the problem is in the code comments. r? ```@lqd``` cc ```@ozkanonur```
2023-08-08Rollup merge of #113480 - Sword-Destiny:master, r=petrochenkovMatthias Krüger-1/+103
add aarch64-unknown-teeos target TEEOS is a mini os run in TrustZone, for trusted/security apps. The libc of TEEOS is a part of musl. The kernel of TEEOS is micro kernel. This MR is to add a target for teeos. MRs for libc and rust-std are in progress. Compiler team MCP: [MCP](https://github.com/rust-lang/compiler-team/issues/652)
2023-08-08Mention riscv64-linux-android support in Android documentationChris Wailes-0/+2
This CL brings the android.md file in-line with the list of supported targets from platform-support.md.
2023-08-08[nit][typo] Remove "currently" that breaks reading flow.Taras Tsugrii-1/+1
2023-08-08use smaller machines in CI PR runsklensy-2/+2
2023-08-08prevent constant rebuilds of rustc-main (and thus everything else)Pietro Albini-21/+36
2023-08-08interpret: remove incomplete protection against invalid where clausesRalf Jung-1/+1
2023-08-08Auto merge of #3020 - rust-lang:rustup-2023-08-08, r=RalfJungbors-1123/+4355
Automatic sync from rustc
2023-08-08Merge from rustcThe Miri Conjob Bot-1122/+4354
2023-08-08Preparing for merge from rustcThe Miri Conjob Bot-1/+1
2023-08-07[perf] Reserve capacity for argvs.Taras Tsugrii-1/+1
This avoids unnecessary allocations to grow vector to sufficient size.
2023-08-08Rollup merge of #114596 - Kobzol:opt-dist-host, r=lqdMatthias Krüger-5/+5
Rename method in `opt-dist` This makes it clearer that the LLVM is the host one (it doesn't necessarily have to be downloaded). On Linux, it comes from the Dockerfile, on Windows it's downloaded. Suggested here: https://github.com/rust-lang/rust/pull/114344#discussion_r1285596217 r? `@lqd`
2023-08-08Rollup merge of #114566 - fmease:type-alias-laziness-is-crate-specific, ↵Matthias Krüger-12/+31
r=oli-obk Store the laziness of type aliases in their `DefKind` Previously, we would treat paths referring to type aliases as *lazy* type aliases if the current crate had lazy type aliases enabled independently of whether the crate which the alias was defined in had the feature enabled or not. With this PR, the laziness of a type alias depends on the crate it is defined in. This generally makes more sense to me especially if / once lazy type aliases become the default in a new edition and we need to think about *edition interoperability*: Consider the hypothetical case where the dependency crate has an older edition (and thus eager type aliases), it exports a type alias with bounds & a where-clause (which are void but technically valid), the dependent crate has the latest edition (and thus lazy type aliases) and it uses that type alias. Arguably, the bounds should *not* be checked since at any time, the dependency crate should be allowed to change the bounds at will with a *non*-major version bump & without negatively affecting downstream crates. As for the reverse case (dependency: lazy type aliases, dependent: eager type aliases), I guess it rules out anything from slight confusion to mild annoyance from upstream crate authors that would be caused by the compiler ignoring the bounds of their type aliases in downstream crates with older editions. --- This fixes #114468 since before, my assumption that the type alias associated with a given weak projection was lazy (and therefore had its variances computed) did not necessarily hold in cross-crate scenarios (which [I kinda had a hunch about](https://github.com/rust-lang/rust/pull/114253#discussion_r1278608099)) as outlined above. Now it does hold. `@rustbot` label F-lazy_type_alias r? `@oli-obk`
2023-08-07Auto merge of #114048 - nikic:llvm-17, r=cuviperbors-5/+5
Update to LLVM 17 Expected LLVM 17.0.0 release date: Sep 5th Rust 1.73 release date: Oct 5th Compatibility changes in this PR: - Drop LLVM_RUSTLLVM check for target-cpu table, which no longer requires a patch with LLVM 17. - Update powerpc data layouts, which now include function alignment information. As usual, downgrade for older LLVM versions. - Adjust the stack-protector.rs test so that the stack smashing does not get optimized away. - Adjust path of crtbegin.c and crtend.c in compiler-rt. - Updated dist-riscv64-linux to use binutils 2.36 in order to recognize the zicsr feature, which is no longer part of the base ISA. - Fixed symlink for asm include directory on dist-various-2. We should use `/usr/include/x86_64-linux-gnu/asm` for the host, rather than `/usr/include/asm-generic`. Upstream patches: - [x] https://reviews.llvm.org/D156525 (backported) Perf run: https://perf.rust-lang.org/compare.html?start=f239bb6bea94d16d902c36d72b5cabdddefb3cab&end=8030d71a95a3ea79f5fc95232c32f9b78effb92d&stat=instructions:u Fixes #109671. Successful: dist-x86_64-linux, dist-aarch64-linux, dist-s390x-linux, dist-powerpc-linux, armhf-gnu, wasm32
2023-08-07Rename method in `opt-dist`Jakub Beránek-5/+5
This makes it clearer that the LLVM is the host one (it doesn't necessarily have to be downloaded).
2023-08-07Symlink correct asm directory on dist-various-2Nikita Popov-2/+2
We should symlink /usr/include/x86_64-linux-gnu/asm for the host triple, rather than /usr/include/asm-generic, which is used in the implementation for asm for specific triple, but shouldn't be used by itself.
2023-08-07Update dist-riscv64-linux to use binutils 2.36Nikita Popov-1/+1
The zicsr feature has been split off from the base ISA. A newer binutils version is required to recognize it.
2023-08-07Adjust path to crtbegin.c / crtend.cNikita Popov-2/+2
These were moved into builtins by https://reviews.llvm.org/D153989.
2023-08-07Update LLVM submoduleNikita Popov-0/+0