| Age | Commit message (Collapse) | Author | Lines |
|
|
|
correctly normalize constants
closes #70317
implements https://github.com/rust-lang/rust/issues/70125#issuecomment-602133708
r? eddyb cc @varkor
|
|
|
|
|
|
Use Reveal::All in MIR optimizations
Resolves some code review feedback in #67662.
Fixes #68855
r? @eddyb
|
|
rustc_mir: remove extra space when pretty-printing MIR.
|
|
|
|
|
|
Smaller and more correct generator codegen
This removes unnecessary panicking branches in the resume function when the generator can not return or unwind, respectively.
Closes https://github.com/rust-lang/rust/issues/66100
It also addresses the correctness concerns wrt poisoning on unwind. These are not currently a soundness issue because any operation *inside* a generator that could possibly unwind will result in a cleanup path for dropping it, ultimately reaching a `Resume` terminator, which we already handled correctly. Future MIR optimizations might optimize that out, though.
r? @Zoxc
|
|
|
|
|
|
Deduplicate pretty printing of constants
r? @eddyb for the pretty printing logic
cc @RalfJung
|
|
examples (e.g. structs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Generator Resume Arguments
cc https://github.com/rust-lang/rust/issues/43122 and https://github.com/rust-lang/rust/issues/56974
Blockers:
* [x] Fix miscompilation when resume argument is live across a yield point (https://github.com/rust-lang/rust/pull/68524#issuecomment-578459069)
* [x] Fix 10% compile time regression in `await-call-tree` benchmarks (https://github.com/rust-lang/rust/pull/68524#issuecomment-578487162)
* [x] Fix remaining 1-3% regression (https://github.com/rust-lang/rust/pull/68524#issuecomment-579566255) - resolved (https://github.com/rust-lang/rust/pull/68524#issuecomment-581144901)
* [x] Make dropck rules account for resume arguments (https://github.com/rust-lang/rust/pull/68524#issuecomment-578541137)
Follow-up work:
* Change async/await desugaring to make use of this feature
* Rewrite [`box_region.rs`](https://github.com/rust-lang/rust/blob/3d8778d767f0dde6fe2bc9459f21ead8e124d8cb/src/librustc_data_structures/box_region.rs) to use resume arguments (this shows up in profiles too)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Remove real_drop_in_place
In https://github.com/rust-lang/rust/commit/af9b057156f610df3528a502c668cfed99ce8a1a, I added `real_drop_in_place` because Stacked Borrows at the time couldn't handle transmuting of mutable references to raw pointers and back. Stacked Borrows 2, however, doesn't have any issue with these transmutes, so it is time to remove this hack again.
|
|
|
|
Turn off const propagation of ref taking
Fixes #67529
Fixes #67640
Fixes #67641
Fixes #67862
r? @oli-obk
|
|
|
|
Add some regression tests
Closes #64848 (fixed by #67631)
Closes #65918 (ICE is hidden by #67000, no longer ICE)
Closes #66473 (fixed by #68084)
Closes #67550 (set mir-opt-level to 3)
r? @Centril
|
|
|
|
|
|
Fixes #67529
Fixes #67640
Fixes #67641
Fixes #67862
|
|
|
|
|
|
|
|
Treat extern statics just like statics in the "const pointer to static" representation
fixes #67612
r? @spastorino
cc @RalfJung this does not affect runtime promotion at all. This is just about promotion within static item bodies.
|
|
libstd uses `core::panic::Location` where possible.
cc @eddyb
|
|
* Removes unnecessary feature flag from track_caller test.
* Tests of panic internals no longer need to explicitly construct Location.
* Add #![warn(const_err)] to retain-never-const per @oli-obk.
* Add track_caller test with diverging function.
|
|
This extends the invalid cases we catch in const prop to include
overflowing integer casts using the same machinery as the overflowing
binary and unary operation logic.
|
|
We only want to return specializations when `Reveal::All` is passed, not
when `Reveal::UserFacing` is. Resolving this fixes several issues with
the `ConstProp`, `SimplifyBranches`, and `Inline` MIR optimization
passes.
Fixes #66901
|
|
representation
|
|
[mir-opt] Fix `Inline` pass to handle inlining into `box` expressions
r? @oli-obk
Before, the test case just ICE'd here:
https://github.com/rust-lang/rust/blob/a605441e049f0b6d5f7715b94b8ac4662fd7fcf6/src/librustc_mir/transform/inline.rs#L668
|
|
|
|
|
|
Const prop should finish propagation into user defined variables
Fixes #66638
~~Temporarily rebased on top of #67015 to get those fixes.~~
r? @oli-obk
|
|
|