rust/tests
bors 36aab8df0a Auto merge of #115301 - Zalathar:regions-vec, r=davidtwco
coverage: Allow each coverage statement to have multiple code regions

The original implementation of coverage instrumentation was built around the assumption that a coverage counter/expression would be associated with *up to one* code region. When it was discovered that *multiple* regions would sometimes need to share a counter, a workaround was found: for the remaining regions, the instrumentor would create a fresh expression that adds zero  to the existing counter/expression.

That got the job done, but resulted in some awkward code, and produces unnecessarily complicated coverage maps in the final binary.

---

This PR removes that tension by changing `StatementKind::Coverage`'s code region field from `Option<CodeRegion>` to `Vec<CodeRegion>`.

The changes on the codegen side are fairly straightforward. As long as each `CoverageKind::Counter` only injects one `llvm.instrprof.increment`, the rest of coverage codegen is happy to handle multiple regions mapped to the same counter/expression, with only minor option-to-vec adjustments.

On the instrumentor/mir-transform side, we can get rid of the code that creates extra (x + 0) expressions. Instead we gather all of the code regions associated with a single BCB, and inject them all into one coverage statement.

---

There are several patches here but they can be divided in to three phases:
- Preparatory work
- Actually switching over to multiple regions per coverage statement
- Cleaning up

So viewing the patches individually may be easier.
2023-10-03 18:36:21 +00:00
..
assembly Limit to LLVM 17.0.2 to work around WinEH codegen bug 2023-10-02 11:06:38 +02:00
auxiliary
codegen Limit to LLVM 17.0.2 to work around WinEH codegen bug 2023-10-02 11:06:38 +02:00
codegen-units
coverage-map coverage: Store each BCB's code regions in one coverage statement 2023-10-03 13:03:39 +11:00
debuginfo
incremental Rollup merge of #116263 - ferrocene:pa-more-bare-metal-fixes, r=oli-obk 2023-09-29 22:27:52 +02:00
mir-opt Auto merge of #115301 - Zalathar:regions-vec, r=davidtwco 2023-10-03 18:36:21 +00:00
pretty
run-coverage coverage: Regression test for functions with unreachable bodies 2023-10-01 14:44:27 +11:00
run-coverage-rustdoc
run-make Auto merge of #113301 - Be-ing:stabilize_bundle_whole-archive, r=petrochenkov 2023-09-29 15:51:48 +00:00
run-make-fulldeps Merge `ExternProviders` into the general `Providers` struct 2023-09-22 20:15:34 +00:00
run-pass-valgrind
rustdoc rustdoc: add URLs for test issues 2023-09-27 17:22:18 -07:00
rustdoc-gui Migrate GUI colors test to original CSS color format 2023-09-23 20:03:03 +02:00
rustdoc-js
rustdoc-js-std
rustdoc-json
rustdoc-ui Add regression test for #102467 2023-09-24 14:09:38 +02:00
ui Rollup merge of #116379 - fmease:opaq-hid-inf-bnds-non-lt-bndrs, r=compiler-errors 2023-10-03 16:24:17 +02:00
ui-fulldeps Remove `rustc_lint_defs::lint_array` 2023-09-28 23:01:25 +02:00
COMPILER_TESTS.md