OpenASIP  2.0
LiveRangeData.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2011 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 
25 /**
26  * @file LiveRangeData.hh
27  *
28  * Declaration of LiveRangeData class.
29  *
30  * Contains live range-related data for one basic block.
31  * This is generated and used by ddg builder.
32  * This may also be used by later parts of the scheduler.
33  *
34  * @author Heikki Kultala 2011 (hkultala@cs.tut.fi)
35  * @note rating: red
36  */
37 
38 #ifndef TTA_LIVERANGE_DATA_HH
39 #define TTA_LIVERANGE_DATA_HH
40 
41 #include "MoveNodeUse.hh"
42 #include "TCEString.hh"
43 
44 #include <set>
45 #include <map>
46 
47 struct LiveRangeData {
48  std::set<TCEString> registersAlive(
49  int cycle, int delaySlots, class DataDependenceGraph& ddg);
50 
51  typedef std::set<MoveNodeUse > MoveNodeUseSet;
52  typedef std::map<TCEString, MoveNodeUseSet > MoveNodeUseMapSet;
53  typedef std::map<TCEString, MoveNodeUse > MoveNodeUseMap;
54  typedef std::map<TCEString, std::pair<MoveNodeUse, MoveNodeUse> >
56 
57  typedef std::pair<TCEString, MoveNodeUseSet > MoveNodeUseSetPair;
58  typedef std::pair<TCEString, MoveNodeUse> MoveNodeUsePair;
59 
60  const std::set<TCEString>& usedAfter() {
61  return registersUsedAfter_;
62  }
63 
64  // merges liverangedata of successor into this.
65  void merge(LiveRangeData& succ);
66 
67  static bool appendUseMapSets(
68  const MoveNodeUseMapSet& srcMap,
69  MoveNodeUseMapSet& dstMap,
70  bool addLoopProperty);
71 
72  static void appendMoveNodeUse(
73  const MoveNodeUseSet& src,
74  MoveNodeUseSet& dst,
75  bool setLoopProperty);
76 
77  // dependencies out from this BB
81 
82  std::map<TCEString, std::pair<MoveNodeUse, bool> >potentialRegKills_;
83 
84  // dependencies in to this BB
88 
89  // dependencies from previous BBs.
92 
93  // all alive after this BB.
96 
97  // dependencies out from this BB
101 
102  // dependencies into this one
106 
107  // deps from previous BBs
110 
111  // all alive after this
114 
115  // fu state deps
119 
120  // live range information
121  std::set<TCEString> registersUsedAfter_;
122  std::set<TCEString> registersUsedInOrAfter_;
123 
124  // Liverange data, initialized from INLINEASM llvm instruction node,
125  // passed to DDG Builder.
126  std::set<TCEString> inlineAsmRegUses_;
127  std::set<TCEString> inlineAsmRegDefs_;
128  std::set<TCEString> inlineAsmClobbers_;
129 };
130 
131 #endif
LiveRangeData::regLastKills_
MoveNodeUseMapPair regLastKills_
Definition: LiveRangeData.hh:80
LiveRangeData::inlineAsmRegDefs_
std::set< TCEString > inlineAsmRegDefs_
Definition: LiveRangeData.hh:127
LiveRangeData::appendMoveNodeUse
static void appendMoveNodeUse(const MoveNodeUseSet &src, MoveNodeUseSet &dst, bool setLoopProperty)
Definition: LiveRangeData.cc:107
LiveRangeData::memFirstUses_
MoveNodeUseMapSet memFirstUses_
Definition: LiveRangeData.hh:104
LiveRangeData::MoveNodeUseSet
std::set< MoveNodeUse > MoveNodeUseSet
Definition: LiveRangeData.hh:51
LiveRangeData::fuDeps_
MoveNodeUseSet fuDeps_
Definition: LiveRangeData.hh:117
LiveRangeData::memFirstDefines_
MoveNodeUseMapSet memFirstDefines_
Definition: LiveRangeData.hh:105
LiveRangeData::inlineAsmClobbers_
std::set< TCEString > inlineAsmClobbers_
Definition: LiveRangeData.hh:128
LiveRangeData::merge
void merge(LiveRangeData &succ)
Definition: LiveRangeData.cc:47
LiveRangeData::regUseReaches_
MoveNodeUseMapSet regUseReaches_
Definition: LiveRangeData.hh:91
LiveRangeData::memLastUses_
MoveNodeUseMapSet memLastUses_
Definition: LiveRangeData.hh:99
LiveRangeData::regDefines_
MoveNodeUseMapSet regDefines_
Definition: LiveRangeData.hh:78
LiveRangeData::regKills_
MoveNodeUseMapPair regKills_
Definition: LiveRangeData.hh:85
LiveRangeData::MoveNodeUseMapSet
std::map< TCEString, MoveNodeUseSet > MoveNodeUseMapSet
Definition: LiveRangeData.hh:52
LiveRangeData::regDefReaches_
MoveNodeUseMapSet regDefReaches_
Definition: LiveRangeData.hh:90
LiveRangeData::memLastKill_
MoveNodeUseMap memLastKill_
Definition: LiveRangeData.hh:100
LiveRangeData::registersAlive
std::set< TCEString > registersAlive(int cycle, int delaySlots, class DataDependenceGraph &ddg)
Definition: LiveRangeData.cc:127
TCEString.hh
LiveRangeData::memDefAfter_
MoveNodeUseMapSet memDefAfter_
Definition: LiveRangeData.hh:112
LiveRangeData::registersUsedInOrAfter_
std::set< TCEString > registersUsedInOrAfter_
Definition: LiveRangeData.hh:122
LiveRangeData::fuDepReaches_
MoveNodeUseSet fuDepReaches_
Definition: LiveRangeData.hh:116
LiveRangeData::memUseAfter_
MoveNodeUseMapSet memUseAfter_
Definition: LiveRangeData.hh:113
LiveRangeData
Definition: LiveRangeData.hh:47
LiveRangeData::regFirstDefines_
MoveNodeUseMapSet regFirstDefines_
Definition: LiveRangeData.hh:87
LiveRangeData::inlineAsmRegUses_
std::set< TCEString > inlineAsmRegUses_
Definition: LiveRangeData.hh:126
LiveRangeData::regLastUses_
MoveNodeUseMapSet regLastUses_
Definition: LiveRangeData.hh:79
LiveRangeData::usedAfter
const std::set< TCEString > & usedAfter()
Definition: LiveRangeData.hh:60
LiveRangeData::regUseAfter_
MoveNodeUseMapSet regUseAfter_
Definition: LiveRangeData.hh:95
LiveRangeData::regDefAfter_
MoveNodeUseMapSet regDefAfter_
Definition: LiveRangeData.hh:94
LiveRangeData::MoveNodeUseMap
std::map< TCEString, MoveNodeUse > MoveNodeUseMap
Definition: LiveRangeData.hh:53
LiveRangeData::potentialRegKills_
std::map< TCEString, std::pair< MoveNodeUse, bool > > potentialRegKills_
Definition: LiveRangeData.hh:82
LiveRangeData::registersUsedAfter_
std::set< TCEString > registersUsedAfter_
Definition: LiveRangeData.hh:121
LiveRangeData::MoveNodeUseSetPair
std::pair< TCEString, MoveNodeUseSet > MoveNodeUseSetPair
Definition: LiveRangeData.hh:57
MoveNodeUse.hh
LiveRangeData::MoveNodeUseMapPair
std::map< TCEString, std::pair< MoveNodeUse, MoveNodeUse > > MoveNodeUseMapPair
Definition: LiveRangeData.hh:55
DataDependenceGraph
Definition: DataDependenceGraph.hh:67
LiveRangeData::memKills_
MoveNodeUseMap memKills_
Definition: LiveRangeData.hh:103
LiveRangeData::fuDepAfter_
MoveNodeUseSet fuDepAfter_
Definition: LiveRangeData.hh:118
LiveRangeData::memDefines_
MoveNodeUseMapSet memDefines_
Definition: LiveRangeData.hh:98
LiveRangeData::appendUseMapSets
static bool appendUseMapSets(const MoveNodeUseMapSet &srcMap, MoveNodeUseMapSet &dstMap, bool addLoopProperty)
Definition: LiveRangeData.cc:79
LiveRangeData::memDefReaches_
MoveNodeUseMapSet memDefReaches_
Definition: LiveRangeData.hh:108
LiveRangeData::regFirstUses_
MoveNodeUseMapSet regFirstUses_
Definition: LiveRangeData.hh:86
LiveRangeData::MoveNodeUsePair
std::pair< TCEString, MoveNodeUse > MoveNodeUsePair
Definition: LiveRangeData.hh:58
LiveRangeData::memUseReaches_
MoveNodeUseMapSet memUseReaches_
Definition: LiveRangeData.hh:109