llvm-mirror/unittests
Chandler Carruth f1fcfdd6f0 [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
Bitcode
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
Linker
MC
MI CodeGen: Remove MachineFunctionAnalysis => Enable (Machine)ModulePasses 2016-08-24 01:52:46 +00:00
ObjectYAML
Option
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