about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform
AgeCommit message (Collapse)AuthorLines
2023-10-25Explain why we check variant equality.Camille GILLOT-0/+15
2023-10-25Move provenance checks out of interning method.Camille GILLOT-4/+17
2023-10-25Directly intern values instead of copying them.Camille GILLOT-3/+6
2023-10-25Do not intern GVN temps.Camille GILLOT-22/+16
2023-10-25Transform large arrays into Repeat expressions when possible.Camille GILLOT-0/+14
2023-10-25Extract simplify_aggregate.Camille GILLOT-27/+56
2023-10-25Do not compute actual aggregate type.Camille GILLOT-11/+47
2023-10-25Simplify repeat expressions.Camille GILLOT-0/+6
2023-10-25Simplify aggregate projections.Camille GILLOT-1/+40
2023-10-25Simplify projections in GVN.Camille GILLOT-50/+106
2023-10-25Do not transmute immediates to non-immediates.Camille GILLOT-0/+10
2023-10-25Do not intern too large aggregates.Camille GILLOT-18/+24
2023-10-25Evaluate computed values to constants.Camille GILLOT-20/+284
2023-10-25Do not visit rvalues twice.Camille GILLOT-8/+11
2023-10-25Do not remove unused definitions inside GVN.Camille GILLOT-12/+3
2023-10-24Auto merge of #115796 - cjgillot:const-prop-rvalue, r=oli-obkbors-18/+172
Generate aggregate constants in DataflowConstProp.
2023-10-24Require target features to match exactly during inliningTomasz Miąsko-4/+2
In general it is not correct to inline a callee with a target features that are subset of the callee. Require target features to match exactly during inlining. The exact match could be potentially relaxed, but this would require identifying specific feature that are allowed to differ, those that need to match, and those that can be present in caller but not in callee. This resolves MIR part of #116573. For other concerns with respect to the previous implementation also see areInlineCompatible in LLVM.
2023-10-24Auto merge of #116300 - cjgillot:split-move, r=petrochenkovbors-95/+96
Separate move path tracking between borrowck and drop elaboration. The primary goal of this PR is to skip creating a `MovePathIndex` for path that do not need dropping in drop elaboration. The 2 first commits are cleanups. The next 2 commits displace `move` errors from move-path builder to borrowck. Move-path builder keeps the same logic, but does not carry error information any more. The remaining commits allow to filter `MovePathIndex` creation according to types. This is used in drop elaboration, to avoid computing dataflow for paths that do not need dropping.
2023-10-23Auto merge of #107009 - cjgillot:jump-threading, r=pnkfelixbors-88/+865
Implement jump threading MIR opt This pass is an attempt to generalize `ConstGoto` and `SeparateConstSwitch` passes into a more complete jump threading pass. This pass is rather heavy, as it performs a truncated backwards DFS on MIR starting from each `SwitchInt` terminator. This backwards DFS remains very limited, as it only walks through `Goto` terminators. It is build to support constants and discriminants, and a propagating through a very limited set of operations. The pass successfully manages to disentangle the `Some(x?)` use case and the DFA use case. It still needs a few tests before being ready.
2023-10-21Use a ConstValue instead.Camille GILLOT-96/+159
2023-10-21Generate ValTrees in DataflowConstProp.Camille GILLOT-4/+95
2023-10-21Typo.Camille GILLOT-1/+1
2023-10-21Remove on_all_drop_children_bits.Camille GILLOT-9/+15
As drop elaboration only tracks places that need dropping, is has become equivalent to `on_all_children_bits`.
2023-10-21Do not create move paths that do not need dropping.Camille GILLOT-2/+18
2023-10-21Give collect_drop_flags and elaborate_drops closer structure.Camille GILLOT-72/+64
2023-10-21Parametrize gather_moves by filter.Camille GILLOT-2/+2
2023-10-21Do not report errors from move path builder.Camille GILLOT-15/+2
2023-10-21Rollup merge of #116974 - Zalathar:signature-spans, r=oli-obk,cjgillotMatthias Krüger-57/+41
coverage: Fix inconsistent handling of function signature spans While doing some more cleanup of `spans`, I noticed a strange inconsistency in how function signatures are handled. Normally the function signature span is treated as though it were executable as part of the start of the function, but in some cases the signature span disappears entirely from coverage, for no obvious reason. This is caused by the fact that spans created by `CoverageSpan::for_fn_sig` don't add the span to their `merged_spans` field (unlike normal statement/terminator spans). In cases where the span-processing code looks at those merged spans, it thinks the signature span is no longer visible and deletes it. Adding the signature span to `merged_spans` resolves the inconsistency. (Prior to #116409 this wouldn't have been possible, because there was no case in the old `CoverageStatement` enum representing a signature. Now that `merged_spans` is just a list of spans, that's no longer an obstacle.)
2023-10-21Expand comment on disappearing edge.Camille GILLOT-1/+1
2023-10-21Correct loop_headers logic.Camille GILLOT-2/+2
2023-10-21Reword TO application comments.Camille GILLOT-3/+4
2023-10-21Simplify static if handling.Camille GILLOT-4/+6
2023-10-21Explicit notation.Camille GILLOT-0/+4
2023-10-21Document Condition.Camille GILLOT-0/+2
2023-10-21Make polarity an enum.Camille GILLOT-11/+23
2023-10-21Document mutated_statement.Camille GILLOT-4/+15
2023-10-21Improve naming and comments.Camille GILLOT-1/+1
2023-10-21Handle more terminators.Camille GILLOT-21/+71
2023-10-21Do not thread through loop headers.Camille GILLOT-3/+42
2023-10-21Implement JumpThreading pass.Camille GILLOT-0/+641
2023-10-21Make instance an option in CostChecker.Camille GILLOT-10/+15
2023-10-21Extract cost checker from inliner.Camille GILLOT-88/+98
2023-10-21coverage: Simplify the injection of coverage statementsZalathar-143/+87
2023-10-21coverage: Simplify initial creation of coverage spansZalathar-45/+32
2023-10-21coverage: Don't create an intermediate vec for each BCB's initial spansZalathar-26/+23
2023-10-21coverage: Handle fn signature spans more consistently near `?`Zalathar-1/+1
2023-10-20s/generator/coroutine/Oli Scherer-129/+129
2023-10-20s/Generator/Coroutine/Oli Scherer-88/+88
2023-10-19Auto merge of #115214 - Urgau:rfc-3127-trim-paths, r=compiler-errorsbors-1/+4
Implement rustc part of RFC 3127 trim-paths This PR implements (or at least tries to) [RFC 3127 trim-paths](https://github.com/rust-lang/rust/issues/111540), the rustc part. That is `-Zremap-path-scope` with all of it's components/scopes. `@rustbot` label: +F-trim-paths
2023-10-19Rollup merge of #116896 - cjgillot:single-inline, r=oli-obkMatthias Krüger-13/+22
Only check in a single place if a pass is enabled. Fixes https://github.com/rust-lang/rust/issues/116294