diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:41:05 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:41:05 +0000 |
| commit | 01095a5d43bbfde13731688ddcf6048ebb8b7721 (patch) | |
| tree | 4def12e759965de927d963ac65840d663ef9d1ea /lib/Target/Hexagon/RDFCopy.h | |
| parent | f0f4822ed4b66e3579e92a89f368f8fb860e218e (diff) | |
Notes
Diffstat (limited to 'lib/Target/Hexagon/RDFCopy.h')
| -rw-r--r-- | lib/Target/Hexagon/RDFCopy.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/Target/Hexagon/RDFCopy.h b/lib/Target/Hexagon/RDFCopy.h index 02531b94c9b04..e8a576cf57a30 100644 --- a/lib/Target/Hexagon/RDFCopy.h +++ b/lib/Target/Hexagon/RDFCopy.h @@ -18,17 +18,20 @@ namespace llvm { class MachineBasicBlock; class MachineDominatorTree; class MachineInstr; -} namespace rdf { struct CopyPropagation { CopyPropagation(DataFlowGraph &dfg) : MDT(dfg.getDT()), DFG(dfg), Trace(false) {} + virtual ~CopyPropagation() {} bool run(); void trace(bool On) { Trace = On; } bool trace() const { return Trace; } + typedef std::map<RegisterRef, RegisterRef> EqualityMap; + virtual bool interpretAsCopy(const MachineInstr *MI, EqualityMap &EM); + private: const MachineDominatorTree &MDT; DataFlowGraph &DFG; @@ -37,12 +40,15 @@ namespace rdf { // map: register -> (map: stmt -> reaching def) std::map<RegisterRef,std::map<NodeId,NodeId>> RDefMap; + // map: statement -> (map: dst reg -> src reg) + std::map<NodeId, EqualityMap> CopyMap; std::vector<NodeId> Copies; - void recordCopy(NodeAddr<StmtNode*> SA, MachineInstr *MI); + void recordCopy(NodeAddr<StmtNode*> SA, EqualityMap &EM); void updateMap(NodeAddr<InstrNode*> IA); bool scanBlock(MachineBasicBlock *B); }; -} +} // namespace rdf +} // namespace llvm #endif |
