about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/mir
AgeCommit message (Collapse)AuthorLines
2021-03-09Switch to changing cp_non_overlap in tformkadmin-1/+1
It was suggested to lower this in MIR instead of ssa, so do that instead.
2021-03-09Update craneliftkadmin-13/+10
2021-03-09Update match brancheskadmin-11/+5
This updates all places where match branches check on StatementKind or UseContext. This doesn't properly implement them, but adds TODOs where they are, and also adds some best guesses to what they should be in some cases.
2021-03-09Update fmt and use of memcpykadmin-1/+1
I'm still not totally sure if this is the right way to implement the memcpy, but that portion compiles correctly now. Now to fix the compile errors everywhere else :).
2021-03-09Impl StatementKind::CopyNonOverlappingkadmin-0/+38
2021-03-09Rollup merge of #82841 - hvdijk:x32, r=joshtriplettMara Bos-9/+9
Change x64 size checks to not apply to x32. Rust contains various size checks conditional on target_arch = "x86_64", but these checks were never intended to apply to x86_64-unknown-linux-gnux32. Add target_pointer_width = "64" to the conditions.
2021-03-08Auto merge of #82727 - oli-obk:shrinkmem, r=pnkfelixbors-12/+26
Test the effect of shrinking the size of Rvalue by 16 bytes r? `@ghost`
2021-03-06Change x64 size checks to not apply to x32.Harald van Dijk-9/+9
Rust contains various size checks conditional on target_arch = "x86_64", but these checks were never intended to apply to x86_64-unknown-linux-gnux32. Add target_pointer_width = "64" to the conditions.
2021-03-05Shrink the size of Rvalue by 16 bytesOli Scherer-13/+15
2021-03-04Remove a dead code pathOli Scherer-12/+0
2021-03-03Check the sizes of Operand, Rvalue, AggregateKind and PlaceOli Scherer-0/+12
2021-03-02errooaaar~Ellen-0/+17
2021-03-01Box generator-related Body fieldsDániel Buga-25/+53
2021-02-26Miscellaneous inlining improvementsTomasz Miąsko-0/+10
Inline a few small and hot functions.
2021-02-25Auto merge of #82338 - RalfJung:interp-error-allocs, r=oli-obkbors-15/+10
all InterpError allocate now, so adjust alloc-error-check Cc https://github.com/rust-lang/rust/pull/82116#discussion_r578310770 r? `@oli-obk`
2021-02-24Auto merge of #80475 - simonvandel:fix-77355, r=oli-obkbors-1/+24
New mir-opt pass to simplify gotos with const values (reopening #77486) Reopening PR #77486 Fixes #77355 This pass optimizes the following sequence ```rust bb2: { _2 = const true; goto -> bb3; } bb3: { switchInt(_2) -> [false: bb4, otherwise: bb5]; } ``` into ```rust bb2: { _2 = const true; goto -> bb5; } ```
2021-02-23Rollup merge of #82091 - henryboisdequin:use-place-ref-more, r=RalfJungDylan DPC-8/+7
use PlaceRef abstractions more consistently Addresses this [comment](https://github.com/rust-lang/rust/pull/80865/files#r558978715) Associated issue: #80647 r? ```@RalfJung```
2021-02-22New mir-opt pass to simplify gotos with const valuesSimon Vandel Sillesen-1/+24
Fixes #77355
2021-02-22Auto merge of #77551 - simonvandel:extend-simplify-branch-same, r=oli-obkbors-22/+43
MIR-OPT: Pass to deduplicate blocks This pass finds basic blocks that are completely equal, and replaces all uses with just one of them. ```bash $ RUSTC_LOG=rustc_mir::transform::deduplicate_blocks ./x.py build --stage 2 | grep "SUCCESS: Replacing: " > log ... $ cat log | wc -l 23875 ```
2021-02-21New pass to deduplicate blocksSimon Vandel Sillesen-22/+43
2021-02-21remove redundant return value Ok(()) of clear_relocations()Matthias Krüger-10/+3
2021-02-20all InterpError allocate now, so adjust alloc-error-checkRalf Jung-15/+10
2021-02-20make `super_projection` take a `PlaceRef`Henry Boisdequin-5/+5
2021-02-18Stabilize `unsafe_op_in_unsafe_fn` lintLeSeulArtichaut-2/+0
2021-02-17Reduce size of InterpErrorInfo to 8 bytesTomasz Miąsko-6/+22
2021-02-16Auto merge of #81611 - cjgillot:meowner, r=estebankbors-9/+8
Only store a LocalDefId in some HIR nodes Some HIR nodes are guaranteed to be HIR owners: Item, TraitItem, ImplItem, ForeignItem and MacroDef. As a consequence, we do not need to store the `HirId`'s `local_id`, and we can directly store a `LocalDefId`. This allows to avoid a bit of the dance with `tcx.hir().local_def_id` and `tcx.hir().local_def_id_to_hir_id` mappings.
2021-02-16make `visit_projection` take a `PlaceRef`Henry Boisdequin-4/+3
2021-02-16update formatingHenry Boisdequin-2/+4
2021-02-15Only store a LocalDefId in hir::Item.Camille GILLOT-2/+1
Items are guaranteed to be HIR owner.
2021-02-15Use an ItemId inside mir::GlobalAsm.Camille GILLOT-8/+8
2021-02-14param_env debugs are instrumental to rustc's successEllen-1/+1
2021-02-14use option<PlaceRef<'tcx>> to clean up mir code a littleHenry Boisdequin-4/+2
2021-02-13debug!("paramenv={}paramenv={}paramenv={}paramenv={}")Ellen-0/+1
2021-02-02Rollup merge of #81665 - jacob-hughes:mir_doc_fix, r=estebankJack Huey-1/+1
Fix out of date `Scalar` documentation Scalars can represent integers up to `u128`, but the docs state otherwise.
2021-02-02Fix out of date `Scalar` documentationJake Hughes-1/+1
Scalars can represent integers up to u128, but the docs state otherwise.
2021-02-02Bump rustfmt versionMark Rousskov-4/+2
Also switches on formatting of the mir build module
2021-01-30Rollup merge of #80959 - jhpratt:unsigned_abs-stabilization, r=m-ou-seYuki Okushi-11/+2
Stabilize `unsigned_abs` Resolves #74913. This PR stabilizes the `i*::unsigned_abs()` method, which returns the absolute value of an integer _as its unsigned equivalent_. This has the advantage that it does not overflow on `i*::MIN`. I have gone ahead and used this in a couple locations throughout the repository.
2021-01-26Auto merge of #80692 - Aaron1011:feature/query-result-debug, r=estebankbors-5/+6
Enforce that query results implement Debug Currently, we require that query keys implement `Debug`, but we do not do the same for query values. This can make incremental compilation bugs difficult to debug - there isn't a good place to print out the result loaded from disk. This PR adds `Debug` bounds to several query-related functions, allowing us to debug-print the query value when an 'unstable fingerprint' error occurs. This required adding `#[derive(Debug)]` to a fairly large number of types - hopefully, this doesn't have much of an impact on compiler bootstrapping times.
2021-01-23Rollup merge of #81243 - osa1:fix_80742_2, r=RalfJungJonas Schievink-0/+3
mir: Improve size_of handling when arg is unsized As discussed on Zulip with `@RalfJung.`
2021-01-21mir: Improve size_of handling when arg is unsizedÖmer Sinan Ağacan-0/+3
2021-01-18Combine instructions immediatelyTomasz Miąsko-1/+1
No functional changes intended
2021-01-16Enforce that query results implement DebugAaron Hill-5/+6
2021-01-14Rollup merge of #80829 - jyn514:dep-constructor, r=michaelwoeristerMara Bos-2/+2
Get rid of `DepConstructor` This removes fully 235 unused functions. Follow-up to https://github.com/rust-lang/rust/pull/80325#discussion_r548491999. r? ``@michaelwoerister`` cc ``@cjgillot``
2021-01-13Use unsigned_abs throughout repositoryJacob Pratt-11/+2
2021-01-13Rollup merge of #80922 - spastorino:revert-inline-always-in-debug, r=wesleywiserDylan DPC-18/+22
Revert "Auto merge of #76896 - spastorino:codegen-inline-fns2 This reverts commit ddf2cc7f8eb34f1a63b491d6a52e3e8208393c09, reversing changes made to 937f629535f38c655267f1ed21ce6830f592f5df. As `@alexcrichton` pointed out in https://github.com/rust-lang/rust/issues/80916 there's a problem with the taken approach.
2021-01-12Auto merge of #78407 - oli-obk:ub_checkable_ctfe, r=RalfJung,pnkfelixbors-2/+11
Make CTFE able to check for UB... ... by not doing any optimizations on the `const fn` MIR used in CTFE. This means we duplicate all `const fn`'s MIR now, once for CTFE, once for runtime. This PR is for checking the perf effect, so we have some data when talking about https://github.com/rust-lang/const-eval/blob/master/rfcs/0000-const-ub.md To do this, we now have two queries for obtaining mir: `optimized_mir` and `mir_for_ctfe`. It is now illegal to invoke `optimized_mir` to obtain the MIR of a const/static item's initializer, an array length, an inline const expression or an enum discriminant initializer. For `const fn`, both `optimized_mir` and `mir_for_ctfe` work, the former returning the MIR that LLVM should use if the function is called at runtime. Similarly it is illegal to invoke `mir_for_ctfe` on regular functions. This is all checked via appropriate assertions and I don't think it is easy to get wrong, as there should be no `mir_for_ctfe` calls outside the const evaluator or metadata encoding. Almost all rustc devs should keep using `optimized_mir` (or `instance_mir` for that matter).
2021-01-11Revert "Auto merge of #76896 - spastorino:codegen-inline-fns2, ↵Santiago Pastorino-18/+22
r=davidtwco,wesleywiser" This reverts commit ddf2cc7f8eb34f1a63b491d6a52e3e8208393c09, reversing changes made to 937f629535f38c655267f1ed21ce6830f592f5df.
2021-01-08Get rid of `DepConstructor`Joshua Nelson-2/+2
This removes fully 235 unused functions.
2021-01-08Auto merge of #78452 - cjgillot:ddk-struct, r=Mark-Simulacrumbors-2/+2
Access query (DepKind) metadata through fields This refactors the access to query definition metadata (attributes such as eval always, anon, has_params) and loading/forcing functions to generate a number of structs, instead of matching on the DepKind enum. This makes access to the fields cheaper to compile. Using a struct means that finding the metadata for a given query is just an offset away; previously the match may have been compiled to a jump table but likely not completely inlined as we expect here. A previous attempt explored a similar strategy, but using trait objects in #78314 that proved less effective, likely due to higher overheads due to forcing dynamic calls and poorer cache utilization (all metadata is fairly densely packed with this PR).
2021-01-08Make DepConstructor a module.Camille GILLOT-2/+2