[PM] Pull the generic graph algorithms and data structures for dominator trees into the Support library

Programming / Compilers / LLVM - Chandler Carruth [gmail.com] - 13 January 2014 04:52 UTC

[PM] Pull the generic graph algorithms and data structures for dominator trees into the Support library.

These are all expressed in terms of the generic GraphTraits and CFG, with no reliance on any concrete IR types. Putting them in support clarifies that and makes the fact that the static analyzer in Clang uses them much more sane. When moving the Dominators.h file into the IR library I claimed that this was the right home for it but not something I planned to work on. Oops.

So why am I doing this? It happens to be one step toward breaking the requirement that IR verification can only be performed from inside of a pass context, which completely blocks the implementation of
verification for the new pass manager infrastructure. Fixing it will also allow removing the concept of the "preverify" step (WTF???) and allow the verifier to cleanly flag functions which fail verification in a way that precludes even computing dominance information. Currently, that results in a fatal error even when you ask the verifier to not fatally error. It's awesome like that.

The yak shaving will continue...

2073b0a [PM] Pull the generic graph algorithms and data structures for dominator trees into the Support library.
include/llvm/CodeGen/MachineDominators.h | 4 +-
include/llvm/IR/DominatorInternals.h | 289 ---------
include/llvm/IR/Dominators.h | 690 +-------------------
include/llvm/IR/Verifier.h | 10 +-
include/llvm/Support/GenericDomTree.h | 718 +++++++++++++++++++++
include/llvm/Support/GenericDomTreeConstruction.h | 289 +++++++++
lib/Analysis/PostDominators.cpp | 2 +-
lib/CodeGen/GCStrategy.cpp | 1 -
lib/IR/Dominators.cpp | 5 +-
lib/Target/R600/AMDILCFGStructurizer.cpp | 1 -
lib/Transforms/Scalar/CodeGenPrepare.cpp | 1 -
11 files changed, 1021 insertions(+), 989 deletions(-)

Upstream: github.com


  • Share