LLVM 24.0.0git
VPlanDominatorTree.h
Go to the documentation of this file.
1//===-- VPlanDominatorTree.h ------------------------------------*- 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/// \file
10/// This file implements dominator tree analysis for a single level of a VPlan's
11/// H-CFG.
12///
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_TRANSFORMS_VECTORIZE_VPLANDOMINATORTREE_H
16#define LLVM_TRANSFORMS_VECTORIZE_VPLANDOMINATORTREE_H
17
18#include "VPlan.h"
19#include "VPlanCFG.h"
22#include "llvm/IR/Dominators.h"
25
26namespace llvm {
27
28template <> struct DomTreeNodeTraits<VPBlockBase> {
31 using ParentPtr = VPlan *;
32
33 static NodePtr getEntryNode(ParentPtr Parent) { return Parent->getEntry(); }
34 static ParentPtr getParent(NodePtr B) { return B->getPlan(); }
35};
36
37/// Template specialization of the standard LLVM dominator tree utility for
38/// VPBlockBases.
39class VPDominatorTree : public DominatorTreeBase<VPBlockBase, false> {
41
42public:
43 explicit VPDominatorTree(VPlan &Plan) { recalculate(Plan); }
44
45 /// Returns true if \p A properly dominates \p B.
47 bool properlyDominates(const VPRecipeBase *A, const VPRecipeBase *B) const;
48};
49
50/// Template specialization of the standard LLVM post-dominator tree utility for
51/// VPBlockBases.
52class VPPostDominatorTree : public PostDomTreeBase<VPBlockBase> {
54
55public:
56 explicit VPPostDominatorTree(VPlan &Plan) { recalculate(Plan); }
57};
58
60
61/// Template specializations of GraphTraits for VPDomTreeNode.
62template <>
65 VPDomTreeNode::const_iterator> {};
66
67template <>
70 VPDomTreeNode::const_iterator> {};
71
73 : public DominanceFrontierBase<VPBlockBase, true> {
74 explicit VPPostDominanceFrontier(const DomTreeT &VPDT);
75};
76} // namespace llvm
77#endif // LLVM_TRANSFORMS_VECTORIZE_VPLANDOMINATORTREE_H
aarch64 promote const
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Generic dominator tree construction - this file provides routines to construct immediate dominator in...
This file defines a set of templates that efficiently compute a dominator tree over a generic graph.
This file defines the little GraphTraits<X> template class that should be specialized by classes that...
This file contains the declarations of the Vectorization Plan base classes:
Base class for the actual dominator tree node.
DominatorTreeBase< VPBlockBase, IsPostDom > DomTreeT
bool properlyDominates(const DomTreeNodeBase< VPBlockBase > *A, const DomTreeNodeBase< VPBlockBase > *B) const
VPBlockBase is the building block of the Hierarchical Control-Flow Graph.
Definition VPlan.h:94
bool properlyDominates(const VPRecipeBase *A, const VPRecipeBase *B) const
VPRecipeBase is a base class modeling a sequence of one or more output IR instructions.
Definition VPlan.h:411
VPlan models a candidate for vectorization, encoding various decisions take to produce efficient outp...
Definition VPlan.h:4788
VPBasicBlock * getEntry()
Definition VPlan.h:4884
This is an optimization pass for GlobalISel generic memory operations.
DominatorTreeBase< T, true > PostDomTreeBase
DomTreeNodeBase< VPBlockBase > VPDomTreeNode
static NodePtr getEntryNode(ParentPtr Parent)
static ParentPtr getParent(NodePtr B)
Default DomTreeNode traits for NodeT.
VPPostDominanceFrontier(const DomTreeT &VPDT)