@@ -9,7 +9,8 @@ Introduction
99============
1010
1111Certain kinds of code transformations can inadvertently result in a loss of
12- debug info, or worse, make debug info misrepresent the state of a program.
12+ debug info, or worse, make debug info misrepresent the state of a program. Debug
13+ info availability is also essential for SamplePGO.
1314
1415This document specifies how to correctly update debug info in various kinds of
1516code transformations, and offers suggestions for how to create targeted debug
@@ -89,9 +90,14 @@ has a location with an accurate scope attached, and b) to prevent misleading
8990single-stepping (or breakpoint) behavior. Often, merged instructions are memory
9091accesses which can trap: having an accurate scope attached greatly assists in
9192crash triage by identifying the (possibly inlined) function where the bad
92- memory access occurred. This rule is also meant to assist SamplePGO by banning
93- scenarios in which a sample of a block containing a merged instruction is
94- misattributed to a block containing one of the instructions-to-be-merged.
93+ memory access occurred.
94+
95+ For SamplePGO, it is often beneficial to retain an arbitrary but deterministic
96+ location instead of discarding line and column information as part of merging.
97+ In particular, loss of location information for calls inhibit optimizations
98+ such as indirect call promotion. This behavior can be optionally enabled until
99+ support for accurately representing merged instructions in the line table is
100+ implemented.
95101
96102Examples of transformations that should follow this rule include:
97103
0 commit comments