1
Fork 0
rust/compiler/rustc_mir_transform
León Orell Valerian Liehr b493369df8
Rollup merge of #133946 - Zalathar:ready-first, r=oli-obk
coverage: Prefer to visit nodes whose predecessors have been visited

In coverage instrumentation, we need to traverse the control-flow graph and decide what kind of counter (physical counter or counter-expression) should be used for each node that needs a counter.

The existing traversal order is complex and hard to tweak. This new traversal order tries to be a bit more principled, by always preferring to visit nodes whose predecessors have already been visited, which is a good match for how the counter-creation code ends up dealing with a node's in-edges and out-edges.

For several of the coverage tests, this ends up being a strict improvement in reducing the size of the coverage metadata, and also reducing the number of physical counters needed.

(The new traversal should hopefully also allow some further code simplifications in the future.)

---

This is made possible by the separate simplification pass introduced by #133849. Without that, almost any change to the traversal order ends up increasing the size of the expression table or the number of physical counters.
2024-12-10 08:55:58 +01:00
..
src Rollup merge of #133946 - Zalathar:ready-first, r=oli-obk 2024-12-10 08:55:58 +01:00
Cargo.toml compiler: Add is_uninhabited and use LayoutS accessors 2024-10-28 09:58:30 -07:00
messages.ftl reduce false positives of tail-expr-drop-order from consumed values 2024-11-20 20:53:11 +08:00