1 //===--- RDFCopy.h --------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
18 class MachineBasicBlock;
19 class MachineDominatorTree;
24 struct CopyPropagation {
25 CopyPropagation(DataFlowGraph &dfg) : MDT(dfg.getDT()), DFG(dfg),
29 void trace(bool On) { Trace = On; }
30 bool trace() const { return Trace; }
33 const MachineDominatorTree &MDT;
35 DataFlowGraph::DefStackMap DefM;
38 // map: register -> (map: stmt -> reaching def)
39 std::map<RegisterRef,std::map<NodeId,NodeId>> RDefMap;
40 std::vector<NodeId> Copies;
42 void recordCopy(NodeAddr<StmtNode*> SA, MachineInstr *MI);
43 void updateMap(NodeAddr<InstrNode*> IA);
44 bool scanBlock(MachineBasicBlock *B);