LLVM: llvm::ModifiedPostOrder< ContextT > Class Template Reference (original) (raw)
template
class llvm::ModifiedPostOrder< ContextT >
Construct a specially modified post-order traversal of cycles.
The ModifiedPO is contructed using a virtually modified CFG as follows:
- The successors of pre-entry nodes (predecessors of an cycle entry that are outside the cycle) are replaced by the successors of the successors of the header.
- Successors of the cycle header are replaced by the exit blocks of the cycle.
Effectively, we produce a depth-first numbering with the following properties:
- Nodes after a cycle are numbered earlier than the cycle header.
- The header is numbered earlier than the nodes in the cycle.
- The numbering of the nodes within the cycle forms an interval starting with the header.
Effectively, the virtual modification arranges the nodes in a cycle as a DAG with the header as the sole leaf, and successors of the header as the roots. A reverse traversal of this numbering has the following invariant on the unmodified original CFG:
Each node is visited after all its predecessors, except if that predecessor is the cycle header.
Definition at line 86 of file GenericUniformityImpl.h.