LLVM 24.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
22
23namespace rdf {
24
27 : MDT(dfg.getDT()), DFG(dfg), RDefMap(RegisterRefLess(DFG.getPRI())) {}
28
29 virtual ~CopyPropagationBase() = default;
30
31 void trace(bool On) { Trace = On; }
32 bool trace() const { return Trace; }
33 DataFlowGraph &getDFG() { return DFG; }
34
35 using EqualityMap = std::map<RegisterRef, RegisterRef, RegisterRefLess>;
36
37protected:
41 bool Trace = false;
42
43 // map: register -> (map: stmt -> reaching def)
44 std::map<RegisterRef, std::map<NodeId, NodeId>, RegisterRefLess> RDefMap;
45 // map: statement -> (map: dst reg -> src reg)
46 std::map<NodeId, EqualityMap> CopyMap;
47};
48
49} // end namespace rdf
50} // end namespace llvm
51
52#endif // LLVM_LIB_TARGET_HEXAGON_RDFCOPY_BASE_H
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
This is an optimization pass for GlobalISel generic memory operations.
std::map< NodeId, EqualityMap > CopyMap
Definition RDFCopyBase.h:46
std::map< RegisterRef, std::map< NodeId, NodeId >, RegisterRefLess > RDefMap
Definition RDFCopyBase.h:44
DataFlowGraph::DefStackMap DefM
Definition RDFCopyBase.h:40
std::map< RegisterRef, RegisterRef, RegisterRefLess > EqualityMap
Definition RDFCopyBase.h:35
CopyPropagationBase(DataFlowGraph &dfg)
Definition RDFCopyBase.h:26
virtual ~CopyPropagationBase()=default
const MachineDominatorTree & MDT
Definition RDFCopyBase.h:38
DenseMap< RegisterId, DefStack > DefStackMap
Definition RDFGraph.h:774