-
- Downloads
DomTree: Extract (mostly) read-only logic into type-erased base classes
Avoid having to instantiate and compile a subset of the dominator tree logic separately for each node type. More importantly, this allows generic algorithms to be built on top of dominator trees without writing them as templates -- such algorithms can now use opaque CfgBlockRef and CfgInterface instead. A type-erased implementation of dominator trees could be written in terms of CfgInterface as well, but doing so would change the current trade-off: it would slightly reduce code size at the cost of a slight runtime overhead. This patch does not change the trade-off, as it only does type-erasure where basic blocks can be treated in a fully opaque way, i.e. it only moves methods that don't require iteration over CFG successors and predecessors. v5: - rename generic_{begin,end,children} back without the generic_ prefix and refer explictly to base class methods in NewGVN, which wants to mutate the order of dominator tree node children directly v6: - style change: iDom -> idom; it's arguable whether this is really invalid, since it is actually standard camelCase, but clang-tidy complains about it so... *shrug* - rename {to,from}Generic -> {wrap,unwrap}Ref Change-Id: Ib860dc04cf8bb093d8ed00be7def40d662213672 Differential Revision: https://reviews.llvm.org/D83089
Showing
- llvm/include/llvm/CodeGen/MachineDominators.h 1 addition, 0 deletionsllvm/include/llvm/CodeGen/MachineDominators.h
- llvm/include/llvm/Support/GenericDomTree.h 250 additions, 347 deletionsllvm/include/llvm/Support/GenericDomTree.h
- llvm/include/llvm/Support/GenericDomTreeConstruction.h 16 additions, 9 deletionsllvm/include/llvm/Support/GenericDomTreeConstruction.h
- llvm/lib/Support/CMakeLists.txt 1 addition, 0 deletionsllvm/lib/Support/CMakeLists.txt
- llvm/lib/Support/GenericDomTree.cpp 278 additions, 0 deletionsllvm/lib/Support/GenericDomTree.cpp
- llvm/lib/Transforms/Scalar/ADCE.cpp 1 addition, 1 deletionllvm/lib/Transforms/Scalar/ADCE.cpp
- llvm/lib/Transforms/Scalar/NewGVN.cpp 5 additions, 3 deletionsllvm/lib/Transforms/Scalar/NewGVN.cpp
Loading
Please register or sign in to comment