| Age | Commit message (Collapse) | Author | Lines |
|
This optimization can result in unsoundness, because it introduces
additional uses of a place holding the discriminant value without
ensuring that it is valid to do so.
|
|
|
|
|
|
The optimization still has some bugs that need to be worked out
such as #77359.
We can try re-enabling this again after the known issues are resolved.
|
|
|
|
|
|
|
|
pretty.rs: Update Closure and Generator print
More detailed outline: https://github.com/rust-lang/project-rfc-2229/pull/17
Closes: https://github.com/rust-lang/project-rfc-2229/issues/11
r? `@nikomatsakis`
cc `@eddyb` `@davidtwco` `@estebank`
|
|
Clean up diagnostics for arithmetic operation errors
Plus a small tweak to a range pattern error message.
|
|
Co-authored-by: Dhruv Jauhar <dhruvjhr@gmail.com>
Co-authored-by: Logan Mosier <logmosier@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fix dest prop miscompilation around references
Closes https://github.com/rust-lang/rust/issues/77002
|
|
Fix #76803 miscompilation
Fixes #76803
Seems like it was an oversight that the discriminant value being set was not compared to the target value from the SwitchInt, as a comment says this is a requirement for the optimization to be sound.
r? `@wesleywiser` since you are probably familiar with the optimization and made #76837 to workaround the bug
|
|
MIR pass to remove unneeded drops on types not needing drop
This is heavily dependent on MIR inlining running to actually see the drop statement.
Do we want to special case replacing a call to std::mem::drop with a goto aswell?
|
|
|
|
SimplifyComparisonIntegral: fix miscompilation
Fixes #76432
Only insert StorageDeads if we actually removed one.
Fixes an issue where we added StorageDead to a place with no StorageLive
r? `@oli-obk`
|
|
|
|
|
|
This is heavily dependent on MIR inlining running to actually see the drop statement
|
|
|
|
This makes the test run deterministic regardless of noopt testruns
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
davidtwco:issue-69925-polymorphic-instancedef-fnptrshim, r=nikomatsakis
shim: monomorphic `FnPtrShim`s during construction
Fixes #69925.
This PR adjusts MIR shim construction so that substitutions are applied to function pointer shims during construction, rather than during codegen (as determined by `substs_for_mir_body`).
r? `@eddyb`
|
|
Implement a generic Destination Propagation optimization on MIR
This takes the work that was originally started by `@eddyb` in https://github.com/rust-lang/rust/pull/47954, and then explored by me in https://github.com/rust-lang/rust/pull/71003, and implements it in a general (ie. not limited to acyclic CFGs) and dataflow-driven way (so that no additional infrastructure in rustc is needed).
The pass is configured to run at `mir-opt-level=2` and higher only. To enable it by default, some followup work on it is still needed:
* Performance needs to be evaluated. I did some light optimization work and tested against `tuple-stress`, which caused trouble in my last attempt, but didn't go much in depth here.
* We can also enable the pass only at `opt-level=2` and higher, if it is too slow to run in debug mode, but fine when optimizations run anyways.
* Debuginfo needs to be fixed after locals are merged. I did not look into what is required for this.
* Live ranges of locals (aka `StorageLive` and `StorageDead`) are currently deleted. We either need to decide that this is fine, or if not, merge the variable's live ranges (or remove these statements entirely – https://github.com/rust-lang/rust/issues/68622).
Some benchmarks of the pass were done in https://github.com/rust-lang/rust/pull/72635.
|
|
Check that the variant index matches the target value from the SwitchInt we came from
|
|
|
|
Add test for checking duplicated branch or-patterns
This adds a regression test for checking `or-patterns` in MIR as shown in #75439.
This doesn't introduce a fix as I'm not sure where it would go(I suspect maybe here: src/librustc_mir_build/build/matches/mod.rs), and I'm not particularly able to fix it.
cc: @lzutao
|
|
|
|
|
|
|
|
The additional copies are due to the lack of copy propagation
|
|
|
|
The new diff is to convince me that this is correct and nothing funky
is going on.
|
|
[mir-opt] Disable the `ConsideredEqual` logic in SimplifyBranchSame opt
The logic is currently broken and we need to disable it to fix a beta
regression (see #76803)
r? `@oli-obk`
|
|
See #75746
|
|
See #75746
|
|
The logic is currently broken and we need to disable it to fix a beta
regression (see #76803)
|
|
inliner: Emit storage markers for introduced arg temporaries
When introducing argument temporaries during inlining, emit storage
marker statements just before the assignment and in the beginning of
the return block.
This ensures that such temporaries will not be considered live across
yield points after inlining inside a generator.
Fixes #71793.
|