We can terminate all the regions up to the last
AST node in the stack, since regions without AST
nodes are refinements of the region with the AST
node, and should be terminated the same. This
avoids leaving some regions that extend past e.g
the `return` of a function.
The region in the test case that changes here is:
```
[[@LINE+9]]:28 -> [[@LINE+12]]:4 : (0 - 1)
```
this was extending past the return. Now it is:
```
[[@LINE]]:6 -> [[@LINE+4]]:11 : (0 - 1)
```
Apologies, I also refactored the test case at the
same time which makes the difference harder to see,
but the main point is that this region now terminates
at the return, the same as the others.
This is a dedicated instruction for incrementing a
profiler counter, which lowers to the
`llvm.instrprof.increment` intrinsic. This
replaces the builtin instruction that was
previously used, and ensures that its arguments
are statically known. This ensures that SIL
optimization passes do not invalidate the
instruction, fixing some code coverage cases in
`-O`.
rdar://39146527
Previously we weren't compensating for label
jumps and returns, i.e we assumed the exit count
is the same as the entry count. Ensure we follow
the same logic that other labeled statements
follow such that control flow is accounted for.
rdar://98881045