| Age | Commit message (Collapse) | Author | Lines |
|
(cherry picked from commit 4c939db0e775df21a0b409b7603eaaf0056e8f86)
|
|
(cherry picked from commit 039af88e09f4f4beb47406f4771bffc2e61d800a)
|
|
(cherry picked from commit b6f22400002f7921feed13e35852e3041cf2b145)
|
|
This reverts commit 685f189b4307435b83d625fea397ef36dff4e955.
|
|
(cherry picked from commit c1da4f1d3c4fc4beb5edcfa8a303a1dcbe27b65e)
|
|
(cherry picked from commit 8dcdb3eb3c28428267bd7bf4cb63e06f9e4330c1)
|
|
(cherry picked from commit b32a5331dcdcc1993fefeff412a20766557e558d)
|
|
(cherry picked from commit 060cc37f3225dd69b5d0df089eec52ff92953b01)
|
|
(cherry picked from commit a5cc4cbe64876c339cc1fb47fb962792bc142146)
|
|
(cherry picked from commit 767f82039c221fa609f752d2a2ea4ffd664f8138)
|
|
(cherry picked from commit a064e786633ac81c35abcf00abd9dc57a40ad9bf)
|
|
(cherry picked from commit 203d3109d8e96a6a4075205e836216d7cd281d5b)
|
|
mode
(cherry picked from commit 4331f55b729d1a41004305f85dfe4dbbcec3ee3f)
|
|
(cherry picked from commit bbe40acb9a192ab2afec1f8adc45c3b72925caf2)
|
|
This aligns the main error message a bit more with the phrasing in the
Edition Guide and provides a bit more information on the labels to
(hopefully!) aid in understanding.
(cherry picked from commit bdc6c4d07b5ccb91df396e152deafc3a66b539ab)
|
|
(cherry picked from commit 724b885b4e486a355d176dc78098e131f9c1b2ef)
|
|
We want kernels to be able to use this bare metal target, so
let's enable the sanitizers that kernels want to use.
(cherry picked from commit 6b06aa619297c198e923e1d406a5bb0534260fef)
|
|
(cherry picked from commit 94562ee1eae83d6cc80bda4d57b43bcdb7a842b5)
|
|
(cherry picked from commit 2c778c1e4ca8053e787998c9b18bb57222719a3d)
|
|
r=davidtwco,RalfJung"
This reverts commit b57d93d8b9525fa261404b4cd9c0670eeb1264b8, reversing
changes made to 0aeaa5eb22180fdf12a8489e63c4daa18da6f236.
(cherry picked from commit 122a55bb442bd1995df9cf9b36e6f65ed3ef4a1d)
|
|
This reverts commit 7c301ecdf5e806b7aa3c44e4a185049fabbc4381, reversing
changes made to dffaad83327454430129802f240121f8c7866208.
(cherry picked from commit 0bb4880581a6963e0b895f9550e9147c68b9537a)
|
|
This reverts commit e108481f74ff123ad98a63bd107a18d13035b275, reversing
changes made to 303e8bd768526a5812bb1776e798e829ddb7d3ca.
(cherry picked from commit ca1c17c88d1f625763859396ba7a50f36ac45cc0)
|
|
(cherry picked from commit d44f021904e3d5b2870e3c835cbad5e1421e83ec)
|
|
diagnostic
Fix #135209.
(cherry picked from commit 5f04f98c9aaf04e5f670e04dc12d4665489859fd)
|
|
The size of this struct depends on the alignment of `u128`, for example
powerpc64le and s390x have align-8 and end up with only 280 bytes. Our
64-bit tier-1 arches are the same though, so let's just assert on those.
(cherry picked from commit aef640a6130ccb3edf9bc720881c3a9dde3c0ecd)
|
|
with dummy spans instead of dropping them entirely
Revert most of #133194 (except the test and the comment fixes). Then refix
not emitting locations at all when the correct location discriminator value
exceeds LLVM's capacity.
(cherry picked from commit 45ef92731b637a60cbad7cecf5382361bbf40531)
|
|
(cherry picked from commit 94bf8f04f402a2410ab85a6e6b9e542e3942b2a2)
|
|
(cherry picked from commit ebbcfd4e7721aaf3211f0e8d3d6e304400c80f78)
|
|
Creating a "trimmed DefID path" when no error is being emitted is an ICE (on purpose). If we create a trimmed path for a lint that is then silenced before being emitted causes a known ICE. This side-steps the issue by always using `with_no_trimmed_path!`.
This was verified to fix https://github.com/quinn-rs/quinn/, but couldn't write a repro case for the test suite.
Fix #135289.
(cherry picked from commit 93a19501c2bad56e73f0ac9f3ae062b614d30832)
|
|
(cherry picked from commit 1b068a0dea794373301f4ddbfb35a378c6805276)
|
|
(cherry picked from commit c55eefe8bc51f302cfc89d375198ca7211d4709b)
|
|
(cherry picked from commit 4a099b29cdb6a7841019406f0f2b5035a1fd9a08)
|
|
(cherry picked from commit 197f6d8081451c5ad394601dbdd8509bbb92f446)
|
|
Co-authored-by: Rémy Rakic <remy.rakic+github@gmail.com>
(cherry picked from commit 13c7122df869f6b29799ea96599cce1fc5880376)
|
|
(cherry picked from commit 34edb21f0bb34916410eb92b108d84075e4abd7e)
|
|
potential violations
(cherry picked from commit 045271ccccd6c485f65ed94aeef3357a512e22fb)
|
|
When `-Cstrip` was changed to use the bundled rust-objcopy instead of
/usr/bin/strip on OSX, strip-like arguments were preserved.
But strip and objcopy are, while being the same binary, different, they
have different defaults depending on which binary they are.
Notably, strip strips everything by default, and objcopy doesn't strip
anything by default.
Additionally, `-S` actually means `--strip-all`, so debuginfo stripped
everything and symbols didn't strip anything.
We now correctly pass `--strip-debug` and `--strip-all`.
|
|
|
|
Remove unused fields from RepeatElementCopy obligation
|
|
taint fcx on selection errors during unsizing
With `feature(dyn_compatible_for_dispatch)` we only check for dyn-compatibility by checking the `T: Unsize<dyn Trait>` predicate during the unsizing coercions checks. If the predicate doesn't hold, we emit an error, but pretend the coercion succeeded to prevent further errors. To prevent const eval from attempting to actually perform this coercion, we need to taint the fcx after reporting the trait errors in the coercion check.
fixes https://github.com/rust-lang/rust/issues/135021
fixes https://github.com/rust-lang/rust/issues/130521
|
|
Make the `test` cfg a userspace check-cfg
This PR implements MCP https://github.com/rust-lang/compiler-team/issues/785, which makes the `test` cfg a "userspace" check-cfg, i.e. no longer included in the well known cfg list.
Things to do:
- [x] Accept the MCP (https://github.com/rust-lang/compiler-team/issues/785#issuecomment-2424121886)
- [x] Mark `test` in Cargo (https://github.com/rust-lang/cargo/pull/14963)
`@rustbot` labels +S-waiting-on-MCP +F-check_cfg
r? `@petrochenkov`
|
|
|
|
|
|
|
|
Range metadata was disabled for amdgpu due to a backend bug. I did not
encounter any problems when removing the workaround to enable range
metadata (tried compiling `core` and `alloc`), so I assume this has
been fixed in LLVM in the last years.
Remove the workaround to re-enable range metadata.
|
|
Autodiff Upstreaming - rustc_codegen_llvm changes
Now that the autodiff/Enzyme backend is merged, this is an upstream PR for the `rustc_codegen_llvm` changes.
It also includes small changes to three files under `compiler/rustc_ast`, which overlap with my frontend PR (https://github.com/rust-lang/rust/pull/129458).
Here I only include minimal definitions of structs and enums to be able to build this backend code.
The same goes for minimal changes to `compiler/rustc_codegen_ssa`, the majority of changes there will be in another PR, once either this or the frontend gets merged.
We currently have 68 files left to merge, 19 in the frontend PR, 21 (+3 from the frontend) in this PR, and then ~30 in the middle-end.
This PR is large because it includes two of my three large files (~800 loc each). I could also first only upstream enzyme_ffi.rs, but I think people might want to see some use of these bindings in the same PR?
To already highlight the things which reviewers might want to discuss:
1) `enzyme_ffi.rs`: I do have a fallback module to make sure that we don't link rustc against Enzyme when we build rustc without autodiff support.
2) `add_panic_msg_to_global` was a pain to write and I currently can't even use it. Enzyme writes gradients into shadow memory. Pass in one float scalar? We'll allocate and return an extra float telling you how this float affected the output. Pass in a slice of floats? We'll let you allocate the vector and pass in a mutable reference to a float slice, we'll then write the gradient into that slice. It should be at least as large as your original slice, so we check that and panic if not. Currently we panic silently, but I already generate a nicer panic message with this function. I just don't know how to print it to the user. yet. I discussed this with a few rustc devs and the best we could come up with (for now), was to look for mangled panic calls in the IR and pick one, which works surprisingly reliably. If someone knows a good way to clean this up and print the panic message I'm all in, otherwise I can remove the code that writes the nicer panic message and keep the silent panic, since it's enough for soundness. Especially since this PR is already a bit larger.
3) `SanitizeHWAddress`: When differentiating C++, Enzyme can use TBAA to "understand" enums/unions, but for Rust we don't have this information. LLVM might to speculative loads which (without TBAA) confuse Enzyme, so we disable those with this attribute. This attribute is only set during the first opt run before Enzyme differentiates code. We then remove it again once we are done with autodiff and run the opt pipeline a second time. Since enums are everywhere in Rust, support for them is crucial, but if this looks too cursed I can remove these ~100 lines and keep them in my fork for now, we can then discuss them separately to make this PR simpler?
4) Duplicated llvm-opt runs: Differentiating already optimized code (and being able to do additional optimizations on the fly, e.g. for GPU code) is _the_ reason why Enzyme is so fast, so the compile time is acceptable for autodiff users: https://enzyme.mit.edu/talks/Publications/ (There are also algorithmic issues in Enzyme core which are more serious than running opt twice).
5) I assume that if we merge these minimal cg_ssa changes here already, I also need to fix the other backends (GCC and cliff) to have dummy implementations, correct?
6) *I'm happy to split this PR up further if reviewers have recommendations on how to.*
For the full implementation, see: https://github.com/rust-lang/rust/pull/129175
Tracking:
- https://github.com/rust-lang/rust/issues/124509
|
|
Fix ICE when opaque captures a duplicated/invalid lifetime
See description on test.
Fixes #132766
Fixes #133693
Fixes #134780
|
|
`ObligationCause` construction tweaks in typeck
Mostly just consolidating the way we construct obligations in `FnCtxt`.
|
|
|
|
|