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.
40 : public DominatorTreeBase<VPBlockBase, false> {
42
43public:
44 explicit VPDominatorTree(VPlan &Plan) { recalculate(Plan); }
45
46 /// Returns true if \p A properly dominates \p B.
47 using Base::properlyDominates;
48 bool properlyDominates(const VPRecipeBase *A, const VPRecipeBase *B) const;
49};
50
51/// Template specialization of the standard LLVM post-dominator tree utility for
52/// VPBlockBases.
53class VPPostDominatorTree : public PostDomTreeBase<VPBlockBase> {
55
56public:
57 explicit VPPostDominatorTree(VPlan &Plan) { recalculate(Plan); }
58};
59
61
62/// Template specializations of GraphTraits for VPDomTreeNode.
63template <>
66 VPDomTreeNode::const_iterator> {};
67
68template <>
71 VPDomTreeNode::const_iterator> {};
72
74 : public DominanceFrontierBase<VPBlockBase, true> {
75 explicit VPPostDominanceFrontier(const DomTreeT &VPDT);
76};
77} // namespace llvm
78#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")
#define LLVM_ABI_FOR_TEST
Definition Compiler.h:220
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
VPBlockBase is the building block of the Hierarchical Control-Flow Graph.
Definition VPlan.h:97
VPRecipeBase is a base class modeling a sequence of one or more output IR instructions.
Definition VPlan.h:413
VPlan models a candidate for vectorization, encoding various decisions take to produce efficient outp...
Definition VPlan.h:4841
VPBasicBlock * getEntry()
Definition VPlan.h:4937
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)