LLVM  8.0.1
MachinePostDominators.h
Go to the documentation of this file.
1 //=- llvm/CodeGen/MachineDominators.h ----------------------------*- C++ -*-==//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file exposes interfaces to post dominance information for
11 // target-specific code.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_CODEGEN_MACHINEPOSTDOMINATORS_H
16 #define LLVM_CODEGEN_MACHINEPOSTDOMINATORS_H
17 
20 
21 namespace llvm {
22 
23 ///
24 /// PostDominatorTree Class - Concrete subclass of DominatorTree that is used
25 /// to compute the post-dominator tree.
26 ///
28 private:
30 
31 public:
32  static char ID;
33 
35 
36  ~MachinePostDominatorTree() override;
37 
39 
41  return DT->getRoots();
42  }
43 
45  return DT->getRootNode();
46  }
47 
49  return DT->getNode(BB);
50  }
51 
53  return DT->getNode(BB);
54  }
55 
57  const MachineDomTreeNode *B) const {
58  return DT->dominates(A, B);
59  }
60 
61  bool dominates(const MachineBasicBlock *A, const MachineBasicBlock *B) const {
62  return DT->dominates(A, B);
63  }
64 
66  const MachineDomTreeNode *B) const {
67  return DT->properlyDominates(A, B);
68  }
69 
71  const MachineBasicBlock *B) const {
72  return DT->properlyDominates(A, B);
73  }
74 
77  return DT->findNearestCommonDominator(A, B);
78  }
79 
80  bool runOnMachineFunction(MachineFunction &MF) override;
81  void getAnalysisUsage(AnalysisUsage &AU) const override;
82  void print(llvm::raw_ostream &OS, const Module *M = nullptr) const override;
83 };
84 } //end of namespace llvm
85 
86 #endif
This class represents lattice values for constants.
Definition: AllocatorList.h:24
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:42
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:61
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:285
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:46
MachineDomTreeNode * operator[](MachineBasicBlock *BB) const