llvm/unittests
Chandler Carruth ed504111e8 [PM/LCG] Teach the LazyCallGraph to maintain reference edges from every
function to every defined function known to LLVM as a library function.

LLVM can introduce calls to these functions either by replacing other
library calls or by recognizing patterns (such as memset_pattern or
vector math patterns) and replacing those with calls. When these library
functions are actually defined in the module, we need to have reference
edges to them initially so that we visit them during the CGSCC walk in
the right order and can effectively rebuild the call graph afterward.

This was discovered when building code with Fortify enabled as that is
a common case of both inline definitions of library calls and
simplifications of code into calling them.

This can in extreme cases of LTO-ing with libc introduce *many* more
reference edges. I discussed a bunch of different options with folks but
all of them are unsatisfying. They either make the graph operations
substantially more complex even when there are *no* defined libfuncs, or
they introduce some other complexity into the callgraph. So this patch
goes with the simplest possible solution of actual synthetic reference
edges. If this proves to be a memory problem, I'm happy to implement one
of the clever techniques to save memory here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308088 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 08:08:19 +00:00
..
ADT [ADT] Fix another "oops" spotted by eddyb and reported in IRC. 2017-07-10 05:41:14 +00:00
Analysis [PM/LCG] Teach the LazyCallGraph to maintain reference edges from every 2017-07-15 08:08:19 +00:00
AsmParser Remove every uses of getGlobalContext() in LLVM (but the C API) 2016-04-14 21:59:01 +00:00
BinaryFormat Revert "Revert "Revert "Revert "Switch external cvtres.exe for llvm's own resource library."""" 2017-07-08 03:06:10 +00:00
Bitcode Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00
CodeGen [GlobalISel] Make multi-step legalization work. 2017-06-30 08:26:20 +00:00
DebugInfo [DWARF] Don't include TestingSupport in LLVM_LINK_COMPONENTS. 2017-06-30 16:50:51 +00:00
ExecutionEngine [ORC] Errorize the ORC APIs. 2017-07-07 02:59:13 +00:00
IR [Dominators] Fix reachable visitation and reenable a unit test 2017-07-15 01:27:16 +00:00
LineEditor Remove autoconf support 2016-01-26 21:29:08 +00:00
Linker Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00
MC Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MI UnitTests: Followup to 305519 2017-06-15 22:50:57 +00:00
Object Fix unittest for buildbot with mips host (32bit big endian) from r295174 2017-02-15 16:03:22 +00:00
ObjectYAML Move ObjectYAML code to a new library. 2016-03-01 19:15:06 +00:00
Option [GSoC] Flag value completion for clang 2017-06-20 16:31:31 +00:00
ProfileData InstrProf: Fix unit test which accidentally used a duplicate name 2017-07-10 21:44:43 +00:00
Support Support: Add llvm::center_justify. 2017-07-13 16:11:08 +00:00
Target UnitTests: Followup to 305519 2017-06-15 22:50:57 +00:00
Transforms [cloning] Do not duplicate types when cloning functions 2017-07-07 18:24:20 +00:00
XRay [XRay][graph] Disambiguate name of type from member name 2017-02-10 06:59:25 +00:00
CMakeLists.txt Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00