LLVM  3.7.0
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 
40  const std::vector<MachineBasicBlock *> &getRoots() const {
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 
76  MachineBasicBlock *B) {
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
MachineDomTreeNode * getRootNode() const
A Module instance is used to store all the information related to an LLVM module. ...
Definition: Module.h:114
MachineBasicBlock * findNearestCommonDominator(MachineBasicBlock *A, MachineBasicBlock *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...
Base class for the actual dominator tree node.
FunctionPass * createMachinePostDominatorTreePass()
Core dominator tree base class.
Definition: LoopInfo.h:56
bool properlyDominates(const MachineBasicBlock *A, const MachineBasicBlock *B) const
MachineDomTreeNode * getNode(MachineBasicBlock *BB) const
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:294
bool dominates(const MachineBasicBlock *A, const MachineBasicBlock *B) const
MachineDomTreeNode * operator[](MachineBasicBlock *BB) const
bool properlyDominates(const MachineDomTreeNode *A, const MachineDomTreeNode *B) const
bool dominates(const MachineDomTreeNode *A, const MachineDomTreeNode *B) const
PostDominatorTree Class - Concrete subclass of DominatorTree that is used to compute the post-dominat...
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:38
const std::vector< MachineBasicBlock * > & getRoots() const