hanchenye-llvm-project/llvm/unittests
Chandler Carruth 49d728ad21 [LCG] Redesign the lazy post-order iteration mechanism for the
LazyCallGraph to support repeated, stable iterations, even in the face
of graph updates.

This is particularly important to allow the CGSCC pass manager to walk
the RefSCCs (and thus everything else) in a module more than once. Lots
of unittests and other tests were hard or impossible to write because
repeated CGSCC pass managers which didn't invalidate the LazyCallGraph
would conclude the module was empty after the first one. =[ Really,
really bad.

The interesting thing is that in many ways this simplifies the code. We
can now re-use the same code for handling reference edge insertion
updates of the RefSCC graph as we use for handling call edge insertion
updates of the SCC graph. Outside of adapting to the shared logic for
this (which isn't trivial, but is *much* simpler than the DFS it
replaces!), the new code involves putting newly created RefSCCs when
deleting a reference edge into the cached list in the correct way, and
to re-formulate the iterator to be stable and effective even in the face
of these kinds of updates.

I've updated the unittests for the LazyCallGraph to re-iterate the
postorder sequence and verify that this all works. We even check for
using alternating iterators to trigger the lazy formation of RefSCCs
after mutation has occured.

It's worth noting that there are a reasonable number of likely
simplifications we can make past this. It isn't clear that we need to
keep the "LeafRefSCCs" around any more. But I've not removed that mostly
because I want this to be a more isolated change.

Differential Revision: https://reviews.llvm.org/D24219

llvm-svn: 281716
2016-09-16 10:20:17 +00:00
..
ADT ADT: Never allocate nodes in iplist<> and ilist<> 2016-09-11 23:43:43 +00:00
Analysis [LCG] Redesign the lazy post-order iteration mechanism for the 2016-09-16 10:20:17 +00:00
AsmParser Remove every uses of getGlobalContext() in LLVM (but the C API) 2016-04-14 21:59:01 +00:00
Bitcode Remove every uses of getGlobalContext() in LLVM (but the C API) 2016-04-14 21:59:01 +00:00
CodeGen GlobalISel: remove "unsized" LLT 2016-09-15 10:09:59 +00:00
DebugInfo [pdb] Fix unit test compilation. 2016-09-14 23:17:08 +00:00
ExecutionEngine [ORC] Fix the RPC unit test for header changes in r281171. 2016-09-11 19:12:19 +00:00
IR Verifier: Mark orphaned DICompileUnits as a debug info failure. 2016-09-14 17:30:37 +00:00
LineEditor Remove autoconf support 2016-01-26 21:29:08 +00:00
Linker Remangle intrinsics names when types are renamed 2016-06-24 15:10:29 +00:00
MC Move ObjectYAML code to a new library. 2016-03-01 19:15:06 +00:00
MI CodeGen: Remove MachineFunctionAnalysis => Enable (Machine)ModulePasses 2016-08-24 01:52:46 +00:00
ObjectYAML Move ObjectYAML code to a new library. 2016-03-01 19:15:06 +00:00
Option Option parser: class for consuming a joined arg in addition to all remaining args 2016-04-15 00:23:30 +00:00
ProfileData Use the range variant of find_if instead of unpacking begin/end 2016-08-12 00:18:03 +00:00
Support Revert "[Support][CommandLine] Add cl::getRegisteredSubcommands()" 2016-09-13 04:11:57 +00:00
Transforms Formatting with clang-format patch r280700 2016-09-06 17:03:02 +00:00
CMakeLists.txt [CMake] Use CMake's default RPATH for the unit tests 2016-09-07 08:37:15 +00:00