about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src
AgeCommit message (Collapse)AuthorLines
2023-09-16coverage: Arrange imports in `rustc_mir_transform::coverage::debug`Zalathar-9/+8
2023-09-14Auto merge of #115817 - fee1-dead-contrib:fix-codegen, r=oli-obkbors-1/+6
treat host effect params as erased in codegen This fixes the changes brought to codegen tests when effect params are added to libcore, by not attempting to monomorphize functions that get the host param by being `const fn`. r? `@oli-obk`
2023-09-14treat host effect params as erased generics in codegenDeadbeef-1/+6
This fixes the changes brought to codegen tests when effect params are added to libcore, by not attempting to monomorphize functions that get the host param by being `const fn`.
2023-09-14make it more clear which functions create fresh AllocIdRalf Jung-1/+1
2023-09-14cleanup op_to_const a bit; rename ConstValue::ByRef → IndirectRalf Jung-3/+3
2023-09-14use AllocId instead of Allocation in ConstValue::ByRefRalf Jung-5/+4
2023-09-13Auto merge of #115820 - matthiaskrgr:rollup-kyglvpu, r=matthiaskrgrbors-1/+15
Rollup of 6 pull requests Successful merges: - #115736 (Remove `verbose_generic_activity_with_arg`) - #115771 (cleanup leftovers of const_err lint) - #115798 (add helper method for finding the one non-1-ZST field) - #115812 (Merge settings.css into rustdoc.css) - #115815 (fix: return early when has tainted in mir pass) - #115816 (Disabled socketpair for Vita) r? `@ghost` `@rustbot` modify labels: rollup
2023-09-13Rollup merge of #115815 - bvanjoi:fix-115809, r=oli-obkMatthias Krüger-0/+5
fix: return early when has tainted in mir pass Fixes https://github.com/rust-lang/rust/issues/115809 As in #115643, `run_pass` is skipped if the body has tainted errors. r? `@oli-obk`
2023-09-13Rollup merge of #115736 - Zoxc:time-cleanup, r=wesleywiserMatthias Krüger-1/+10
Remove `verbose_generic_activity_with_arg` This removes `verbose_generic_activity_with_arg` and changes users to `generic_activity_with_arg`. This keeps the output of `-Z time` readable while these repeated events are still available with the self profiling mechanism.
2023-09-13Auto merge of #115797 - cjgillot:const-prop-noclone, r=oli-obkbors-129/+102
Do not clone the Body for ConstProp ~Based on https://github.com/rust-lang/rust/pull/115748 for the `POST_MONO_CHECKS` flag.~
2023-09-13fix: skip opt if body has tainted errorbohan-0/+5
2023-09-13Generate MIR pass names for profiling on the fly and pass the body DefId as ↵John Kåre Alsaker-4/+10
argument
2023-09-13make the set of methods between our two Const types more consistentRalf Jung-2/+2
2023-09-13make the eval() functions on our const types return the resulting valueRalf Jung-5/+3
2023-09-12Do not fetch type to check generator.Camille GILLOT-1/+1
2023-09-12Do not clone body for ConstProp.Camille GILLOT-25/+8
2023-09-12Reuse CollectAndPatch for normal ConstProp.Camille GILLOT-90/+72
2023-09-12Store a ConstantKind in CollectAndPatch.Camille GILLOT-23/+28
2023-09-12Introduce Machine::POST_MONO_CHECKS.Camille GILLOT-0/+3
2023-09-11Remove cur_span hook.Camille GILLOT-7/+3
2023-09-11Reuse throw_machine_stop_str! macro.Camille GILLOT-53/+24
2023-09-11Return ImmTy in discriminant_for_variant.Camille GILLOT-8/+5
2023-09-11Interpret Immediate::Uninit as Bottom.Camille GILLOT-13/+10
2023-09-11Support CopyForDeref.Camille GILLOT-0/+6
2023-09-11Handle reading statics.Camille GILLOT-38/+86
2023-09-11Support non-scalar constants.Camille GILLOT-6/+100
2023-09-10Remove `verbose_generic_activity_with_arg`John Kåre Alsaker-1/+4
2023-09-08Auto merge of #115612 - cjgillot:const-prop-int, r=oli-obkbors-116/+207
Improvements to dataflow const-prop Partially cherry-picked from https://github.com/rust-lang/rust/pull/110719 r? `@oli-obk` cc `@jachris`
2023-09-08Rollup merge of #115643 - bvanjoi:fix-115203, r=RalfJung,oli-obkGuillaume Gomez-0/+4
fix: return early when has tainted in mir-lint Fixes #115203 `a[..]` is of indeterminate size, it had been reported error during borrow check, therefore we skip the mir lint process.
2023-09-08Auto merge of #115586 - Zalathar:query, r=cjgillotbors-72/+51
coverage: Simplify the `coverageinfo` query The `coverageinfo` query walks through a `mir::Body`'s statements to find the total number of coverage counter IDs and coverage expression IDs that have been used, as this information is needed by coverage codegen. This PR makes 3 nice simplifications to that query: - Extract a common iterator over coverage statements, shared by both coverage-related queries - Simplify the query's visitor from two passes to just one pass - Explicitly track the highest seen IDs in the visitor, and only convert to a count right at the end I also updated some related comments. Some had been invalidated by these changes, while others had already been invalidated by previous coverage changes.
2023-09-08fix: return ealry when has tainted in mir-lintbohan-0/+4
2023-09-07Auto merge of #115602 - oli-obk:lower_intrinsics, r=petrochenkovbors-18/+1
Don't report any errors in `lower_intrinsics`. Intrinsics should have been type checked earlier. This is part of moving all mir-opt diagnostics early enough so that they are reliably emitted even in check builds: https://github.com/rust-lang/rust/issues/49292#issuecomment-1692212095
2023-09-07coverage: In the visitor, track max counter/expression IDs without +1Zalathar-25/+25
This makes the visitor track the highest seen counter/expression IDs directly, and only add +1 (to convert to a vector length) at the very end.
2023-09-07coverage: Simplify the `coverageinfo` query to a single passZalathar-30/+13
2023-09-07coverage: Extract a common iterator over a function's coverage statementsZalathar-23/+19
Both of the coverage queries can now use this one helper function to iterate over all of the `mir::Coverage` payloads in the statements of a `mir::Body`.
2023-09-06Auto merge of #115615 - matthiaskrgr:rollup-49fosdf, r=matthiaskrgrbors-1/+1
Rollup of 9 pull requests Successful merges: - #114511 (Remove the unhelpful let binding diag comes from FormatArguments) - #115473 (Add explanatory note to 'expected item' error) - #115574 (Replace `rustc_data_structures` dependency with `rustc_index` in `rustc_parse_format`) - #115578 (Clarify cryptic comments) - #115587 (fix #115348) - #115596 (A small change) - #115598 (Fix log formatting in bootstrap) - #115605 (Better Debug for `Ty` in smir) - #115614 (Fix minor grammar typo) r? `@ghost` `@rustbot` modify labels: rollup
2023-09-06Auto merge of #115252 - cjgillot:mir-composite, r=davidtwcobors-62/+36
Represent MIR composite debuginfo as projections instead of aggregates Composite debuginfo for MIR is currently represented as ``` debug name => Type { projection1 => place1, projection2 => place2 }; ``` ie. a single `VarDebugInfo` object with that name, and its value a `VarDebugInfoContents::Composite`. This PR proposes to reverse the representation to be ``` debug name.projection1 => place1; debug name.projection2 => place2; ``` ie. multiple `VarDebugInfo` objects with each their projection. This simplifies the handling of composite debuginfo by the compiler by avoiding weird nesting. Based on https://github.com/rust-lang/rust/pull/115139
2023-09-06Propagate PlaceElem::Index.Camille GILLOT-11/+33
2023-09-06Support array length.Camille GILLOT-0/+30
2023-09-06Implement algebraic simplifications.Camille GILLOT-4/+32
2023-09-06Support a few more rvalues.Camille GILLOT-33/+50
2023-09-06fix #115348mojave2-1/+1
2023-09-06Don't report any errors in `lower_intrinsics`. They should have been ↵Oli Scherer-18/+1
typecked before.
2023-09-05Support non-trivial scalars in ConstProp.Camille GILLOT-1/+1
2023-09-05Remove type from ScalarTy.Camille GILLOT-68/+62
2023-09-05Auto merge of #115507 - cjgillot:relative-source-file, r=oli-obkbors-19/+14
Use relative positions inside a SourceFile. This allows to remove the normalization of start positions for hashing, and simplify allocation of global address space. cc `@Zoxc`
2023-09-05Refactor how MIR represents composite debuginfo.Camille GILLOT-62/+36
2023-09-05Rollup merge of #115536 - RalfJung:interpreter-privacy, r=oli-obkMatthias Krüger-20/+24
interpret: make MemPlace, Place, Operand types private to the interpreter Outside the interpreter, only the typed versions should be used.
2023-09-05Auto merge of #115553 - matthiaskrgr:rollup-c0045hz, r=matthiaskrgrbors-5/+5
Rollup of 5 pull requests Successful merges: - #115353 (Emit error instead of ICE when optimized MIR is missing) - #115488 (Take `&mut Results` in `ResultsVisitor`) - #115492 (Allow `large_assignments` for Box/Arc/Rc initialization) - #115519 (Don't ICE on associated type projection without feature gate in new solver) - #115534 (Expose more information with DefId in smir) r? `@ghost` `@rustbot` modify labels: rollup
2023-09-04read_via_copy: don't prematurely optimize away the readRalf Jung-12/+11