Commit Graph

6 Commits

Author SHA1 Message Date
Hamish Knight
25e6e96016 [Profiler] Avoid crashing on redundant break in repeat-while
Treat subtracting zero as a no-op, avoiding the
assertion guarding against creating negative
counters.
2023-11-30 13:23:26 +00:00
Hamish Knight
bb48233695 [Profiler] Avoid recording empty regions
These are redundant.
2023-11-16 17:28:57 +00:00
Hamish Knight
b12015c343 [SIL] Introduce the increment_profiler_counter instruction
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
2022-09-07 17:55:13 +01:00
Slava Pestov
45330816b4 Profile: Run tests through to -emit-ir to get better coverage 2020-03-17 19:03:03 -04:00
Vedant Kumar
d3ea09fafc [Coverage] Fix mappings of regions following do-catch stmts
Coverage reporting for source regions following do-catch statements was
incorrect, because it did not properly reflect early exits.

rdar://34244637
2018-05-18 12:11:14 -07:00
Vedant Kumar
c3f4d99e57 Group the the code coverage, profiling, and pgo tests together (#16070)
* Group tests for profiling instrumentation together, NFC

This will make it easier to test changes to the code coverage logic.

There are a handful of tests which relate to profiling which I have not
moved. These include tests for the driver and for the SIL optimizer. It
makes more sense to keep those tests where they are.

* Rename a test file, NFC

This file tests code coverage of primary files, so I've changed the name
of the file to reflect that.

* Simplify the check lines in a test, NFC

This file tests code coverage of closures. It had several check lines
which obscured the meaning of the test, and its check lines were in a
strange order.

Remove the extra checks and disable -emit-sorted-sil.
2018-04-20 15:15:52 -07:00