LLVM 23.0.0git
RDFCopyBase.h
Go to the documentation of this file.
1//===--- RDFCopyBase.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#ifndef LLVM_LIB_TARGET_HEXAGON_RDFCOPY_BASE_H
10#define LLVM_LIB_TARGET_HEXAGON_RDFCOPY_BASE_H
11
16#include <map>
17#include <vector>
18
19namespace llvm {
20
23class MachineInstr;
24
25namespace rdf {
26
29 : MDT(dfg.getDT()), DFG(dfg), RDefMap(RegisterRefLess(DFG.getPRI())) {}
30
31 virtual ~CopyPropagationBase() = default;
32
33 void trace(bool On) { Trace = On; }
34 bool trace() const { return Trace; }
35 DataFlowGraph &getDFG() { return DFG; }
36
37 using EqualityMap = std::map<RegisterRef, RegisterRef, RegisterRefLess>;
38
39protected:
43 bool Trace = false;
44
45 // map: register -> (map: stmt -> reaching def)
46 std::map<RegisterRef, std::map<NodeId, NodeId>, RegisterRefLess> RDefMap;
47 // map: statement -> (map: dst reg -> src reg)
48 std::map<NodeId, EqualityMap> CopyMap;
49};
50
51} // end namespace rdf
52} // end namespace llvm
53
54#endif // LLVM_LIB_TARGET_HEXAGON_RDFCOPY_BASE_H
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
Representation of each machine instruction.
This is an optimization pass for GlobalISel generic memory operations.
std::map< NodeId, EqualityMap > CopyMap
Definition RDFCopyBase.h:48
std::map< RegisterRef, std::map< NodeId, NodeId >, RegisterRefLess > RDefMap
Definition RDFCopyBase.h:46
DataFlowGraph::DefStackMap DefM
Definition RDFCopyBase.h:42
std::map< RegisterRef, RegisterRef, RegisterRefLess > EqualityMap
Definition RDFCopyBase.h:37
CopyPropagationBase(DataFlowGraph &dfg)
Definition RDFCopyBase.h:28
virtual ~CopyPropagationBase()=default
const MachineDominatorTree & MDT
Definition RDFCopyBase.h:40
std::unordered_map< RegisterId, DefStack > DefStackMap
Definition RDFGraph.h:775