[PATCH] D46357: [GCOV] Emit the writeout function as nested loops of global data.

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 2 05:12:14 PDT 2018


chandlerc created this revision.
chandlerc added reviewers: wmi, echristo.
Herald added subscribers: hiraditya, mcrosier, sanjoy.

Prior to this change, LLVM would in some cases emit *massive* writeout
functions with many 10s of 1000s of function calls in straight-line
code. This is a very wasteful way to represent what are fundamentally
loops and creates a number of scalability issues. Among other things,
register allocating these calls is extremely expensive. While https://reviews.llvm.org/D46127 makes this
less severe, we'll still run into scaling issues with this eventually. If not
in the compile time, just from the code size.

Now the pass builds up global data structures modeling the inputs to
these functions, and simply loops over the data structures calling the
relevant functions with those values. This ensures that the code size is
a fixed and only data size grows with larger amounts of coverage data.

A trivial change to IRBuilder is included to make it easier to build
the constants that make up the global data.


Repository:
  rL LLVM

https://reviews.llvm.org/D46357

Files:
  llvm/include/llvm/IR/IRBuilder.h
  llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
  llvm/test/Transforms/GCOVProfiling/function-numbering.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46357.144860.patch
Type: text/x-patch
Size: 14025 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180502/5ad4766a/attachment.bin>


More information about the llvm-commits mailing list