about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform
AgeCommit message (Collapse)AuthorLines
2023-09-20interpret: more consistently use ImmTy in operators and castsRalf Jung-9/+11
2023-09-20coverage: Remove vestigial counter/expression debug labelsZalathar-22/+5
2023-09-20coverage: Remove vestigial `format_counter` methodsZalathar-40/+20
2023-09-20coverage: Remove debug code from the instrumentorZalathar-986/+16
2023-09-20the Const::eval_bits methods don't need to be given the TyRalf Jung-3/+3
2023-09-19move ConstValue into mirRalf Jung-6/+5
this way we have mir::ConstValue and ty::ValTree as reasonably parallel
2023-09-19Rollup merge of #115930 - Zalathar:spans-bug, r=compiler-errorsMatthias Krüger-31/+17
coverage: Fix an unstable-sort inconsistency in coverage spans This code was calling `sort_unstable_by`, but failed to impose a total order on the initial spans. That resulted in unpredictable handling of closure spans, producing inconsistencies in the coverage maps and in user-visible coverage reports. This PR fixes the problem by always sorting closure spans before otherwise-identical non-closure spans, and also switches to a stable sort in case the ordering is still not total. --- In addition to the fix itself, this PR also contains a cleanup to the comparison function that I was working on when I discovered the bug.
2023-09-18coverage: Simplify sorting of coverage spans extracted from MIRZalathar-33/+16
Switching to `Ordering::then_with` makes control-flow less complicated, and there is no need to use `partial_cmp` here.
2023-09-18coverage: Fix an unstable-sort inconsistency in coverage spansZalathar-1/+4
This code was calling `sort_unstable_by`, but failed to impose a total order on the initial spans. That resulted in unpredictable handling of closure spans, producing inconsistencies in the coverage maps and in user-visible coverage reports. This patch fixes the problem by always sorting closure spans before otherwise-identical non-closure spans, and also switches to a stable sort in case the ordering is still not total.
2023-09-18Rollup merge of #115908 - cjgillot:lint-noclone, r=oli-obkMatthias Krüger-21/+4
Do not clone MIR for const-prop lint. Addresses https://github.com/rust-lang/rust/pull/115797#issuecomment-1721250533
2023-09-17Do not clone MIR for const-prop lint.Camille GILLOT-21/+4
2023-09-16coverage: Replace an unnecessary map with a setZalathar-7/+7
This hashmap's values were never used.
2023-09-16coverage: Simplify internal representation of debug typesZalathar-135/+131
2023-09-16coverage: Update log module names in debug docsZalathar-2/+2
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-20/+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