[PATCH] D52088: [GCOV] Don't add a useless block in the entry

calixte via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 14 05:54:36 PDT 2018


calixte created this revision.
calixte added a reviewer: vsk.
Herald added a subscriber: llvm-commits.

Currently, we split the entry block of a function to be sure to have at least one edge. In fact it's useless since we can add this edge in gcno/gcda without creating it.
There are several pros to do that:

- slightly reduce gcno/gcda size (close to nothing...).
- fix a crash when there are several CU attached to a module (the entry block was splitted several times)
- when using -femit-coverage-data the entry was not splitted since it's currently done when emitting coverage notes, so no instrumentation added when there was only on block.


Repository:
  rL LLVM

https://reviews.llvm.org/D52088

Files:
  lib/Transforms/Instrumentation/GCOVProfiling.cpp
  test/Transforms/GCOVProfiling/Inputs/
  test/Transforms/GCOVProfiling/Inputs/empty-function-1.ll
  test/Transforms/GCOVProfiling/Inputs/empty-function-2.ll
  test/Transforms/GCOVProfiling/multiple-cus.ll
  test/Transforms/GCOVProfiling/return-block.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52088.165484.patch
Type: text/x-patch
Size: 5514 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180914/caca7166/attachment.bin>


More information about the llvm-commits mailing list