LLVM 22.0.0git
IteratedDominanceFrontier.h
Go to the documentation of this file.
1//===- IteratedDominanceFrontier.h - Calculate IDF --------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_ANALYSIS_ITERATEDDOMINANCEFRONTIER_H
10#define LLVM_ANALYSIS_ITERATEDDOMINANCEFRONTIER_H
11
14
15namespace llvm {
16
17class BasicBlock;
18
20
21/// Specialization for BasicBlock for the optional use of GraphDiff.
22template <bool IsPostDom> struct ChildrenGetterTy<BasicBlock, IsPostDom> {
25
26 ChildrenGetterTy() = default;
30
31 ChildrenTy get(const NodeRef &N);
32
34};
35
36} // end of namespace IDFCalculatorDetail
37
38template <bool IsPostDom>
54
57
58//===----------------------------------------------------------------------===//
59// Implementation.
60//===----------------------------------------------------------------------===//
61
62namespace IDFCalculatorDetail {
63
64template <bool IsPostDom>
67
68 using OrderedNodeTy =
70
71 if (!GD) {
72 auto Children = children<OrderedNodeTy>(N);
73 return {Children.begin(), Children.end()};
74 }
75
76 return GD->template getChildren<IsPostDom>(N);
77}
78
79} // end of namespace IDFCalculatorDetail
80
81} // end of namespace llvm
82
83#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Compute iterated dominance frontiers using a linear time algorithm.
LLVM Basic Block Representation.
Definition BasicBlock.h:62
Core dominator tree base class.
Determine the iterated dominance frontier, given a set of defining blocks, and optionally,...
std::conditional_t< IsPostDom, Inverse< NodeTy * >, NodeTy * > OrderedNodeTy
IDFCalculatorDetail::ChildrenGetterTy< NodeTy, IsPostDom > ChildrenGetterTy
IDFCalculator(DominatorTreeBase< BasicBlock, IsPostDom > &DT, const GraphDiff< BasicBlock *, IsPostDom > *GD)
IDFCalculator(DominatorTreeBase< BasicBlock, IsPostDom > &DT)
typename llvm::IDFCalculatorBase< BasicBlock, IsPostDom > IDFCalculatorBase
typename IDFCalculatorBase::ChildrenGetterTy ChildrenGetterTy
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
This is an optimization pass for GlobalISel generic memory operations.
IDFCalculator< true > ReverseIDFCalculator
IDFCalculator< false > ForwardIDFCalculator
iterator_range< typename GraphTraits< GraphType >::ChildIteratorType > children(const typename GraphTraits< GraphType >::NodeRef &G)
#define N