LLVM  9.0.0svn
MachinePostDominators.h
Go to the documentation of this file.
1 //===- llvm/CodeGen/MachinePostDominators.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 // This file exposes interfaces to post dominance information for
10 // target-specific code.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CODEGEN_MACHINEPOSTDOMINATORS_H
15 #define LLVM_CODEGEN_MACHINEPOSTDOMINATORS_H
16 
19 
20 namespace llvm {
21 
22 ///
23 /// PostDominatorTree Class - Concrete subclass of DominatorTree that is used
24 /// to compute the post-dominator tree.
25 ///
27 private:
29 
30 public:
31  static char ID;
32 
34 
35  ~MachinePostDominatorTree() override;
36 
38 
40  return DT->getRoots();
41  }
42 
44  return DT->getRootNode();
45  }
46 
48  return DT->getNode(BB);
49  }
50 
52  return DT->getNode(BB);
53  }
54 
56  const MachineDomTreeNode *B) const {
57  return DT->dominates(A, B);
58  }
59 
60  bool dominates(const MachineBasicBlock *A, const MachineBasicBlock *B) const {
61  return DT->dominates(A, B);
62  }
63 
65  const MachineDomTreeNode *B) const {
66  return DT->properlyDominates(A, B);
67  }
68 
70  const MachineBasicBlock *B) const {
71  return DT->properlyDominates(A, B);
72  }
73 
76  return DT->findNearestCommonDominator(A, B);
77  }
78 
79  bool runOnMachineFunction(MachineFunction &MF) override;
80  void getAnalysisUsage(AnalysisUsage &AU) const override;
81  void print(llvm::raw_ostream &OS, const Module *M = nullptr) const override;
82 };
83 } //end of namespace llvm
84 
85 #endif
This class represents lattice values for constants.
Definition: AllocatorList.h:23
A Module instance is used to store all the information related to an LLVM module. ...
Definition: Module.h:65
MachineBasicBlock * findNearestCommonDominator(MachineBasicBlock *A, MachineBasicBlock *B)
const SmallVectorImpl< MachineBasicBlock * > & getRoots() const
NodeT * findNearestCommonDominator(NodeT *A, NodeT *B) const
findNearestCommonDominator - Find nearest common dominator basic block for basic block A and B...
bool properlyDominates(const MachineDomTreeNode *A, const MachineDomTreeNode *B) const
bool properlyDominates(const DomTreeNodeBase< NodeT > *A, const DomTreeNodeBase< NodeT > *B) const
properlyDominates - Returns true iff A dominates B and A != B.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:41
const SmallVectorImpl< NodeT * > & getRoots() const
getRoots - Return the root blocks of the current CFG.
Base class for the actual dominator tree node.
MachineDomTreeNode * getRootNode() const
FunctionPass * createMachinePostDominatorTreePass()
Core dominator tree base class.
Definition: LoopInfo.h:60
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
bool dominates(const MachineDomTreeNode *A, const MachineDomTreeNode *B) const
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:284
DomTreeNodeBase< NodeT > * getRootNode()
getRootNode - This returns the entry node for the CFG of the function.
DomTreeNodeBase< NodeT > * getNode(const NodeT *BB) const
getNode - return the (Post)DominatorTree node for the specified basic block.
PostDominatorTree Class - Concrete subclass of DominatorTree that is used to compute the post-dominat...
bool properlyDominates(const MachineBasicBlock *A, const MachineBasicBlock *B) const
bool dominates(const DomTreeNodeBase< NodeT > *A, const DomTreeNodeBase< NodeT > *B) const
dominates - Returns true iff A dominates B.
MachineDomTreeNode * getNode(MachineBasicBlock *BB) const
bool dominates(const MachineBasicBlock *A, const MachineBasicBlock *B) const
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
void print(llvm::raw_ostream &OS, const Module *M=nullptr) const override
print - Print out the internal state of the pass.
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:45
MachineDomTreeNode * operator[](MachineBasicBlock *BB) const