Commit Graph

10 Commits

Author SHA1 Message Date
Hamish Knight
c3b055a9a8 [Profiler] Improve if statement coverage
Fix counters for regions following `else if`s, fix
the counters for `else if` conditions, and fix
handling of `break` statements. Also while here,
clean up the handling of branch exit regions such
that we don't generate multiple overlapping
regions for each branch, but a single region at
the end of the entire `if` statement that accounts
for all exiting control flow.

rdar://104078910
rdar://104079242
2023-12-04 11:09:01 +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
Hamish Knight
19e1e2f7a2 [SILGen] Fix deinit coverage mapping
Stop profiling the deallocating deinitializer
function for non-ObjC classes, and instead profile
the destructor, which is where we emit the user's
code written in a `deinit`.

rdar://54443107
2022-08-11 15:09:53 +01:00
Hamish Knight
2f38f83050 [test] Rename a test 2022-08-11 15:09:53 +01:00
Slava Pestov
9ec80df97e SIL: Remove curried SILDeclRefs 2020-03-19 02:20:21 -04:00
Slava Pestov
45330816b4 Profile: Run tests through to -emit-ir to get better coverage 2020-03-17 19:03:03 -04:00
Erik Eckstein
39bb14b094 change mangling prefix from $S to $s
This is the final ABI mangling prefix

rdar://problem/38471478
2018-09-19 13:55:11 -07:00
Slava Pestov
301d9f0cf3 AST: Give destructors a second parameter list
Constructors and methods had two parameter lists, one for self and one
for the formal parameters. Destructors only had one parameter list,
which introduced an annoying corner case.
2018-07-19 12:28:13 -07:00
Vedant Kumar
d71d3fb0f7 [Coverage] Test lowering of ill-formed SIL profiling intrinsics (#16607)
* [Coverage] Parse SIL coverage maps for top-level code decls

This adds SIL printer/parser support for SILCoverageMaps representing
top-level code decls.

* [Coverage] Test lowering of ill-formed SIL profiling intrinsics

This adds a test case to exercise a path in IRGen which discards
ill-formed profiling intrinsics.

rdar://40133800 & r://39146527
2018-05-15 11:16:31 -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