dep_graph.hh (7720:65d338a8dba4) dep_graph.hh (9444:ab47fe7f03f0)
1/*
1/*
2 * Copyright (c) 2012 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated
11 * unmodified and in its entirety in all distributions of the software,
12 * modified or unmodified, in source code or in binary form.
13 *
2 * Copyright (c) 2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
9 * redistributions in binary form must reproduce the above copyright

--- 78 unchanged lines hidden (view full) ---

88 { dependGraph[idx].inst = NULL; }
89
90 /** Removes an instruction from a single linked list. */
91 void remove(PhysRegIndex idx, DynInstPtr &inst_to_remove);
92
93 /** Removes and returns the newest dependent of a specific register. */
94 DynInstPtr pop(PhysRegIndex idx);
95
14 * Copyright (c) 2006 The Regents of The University of Michigan
15 * All rights reserved.
16 *
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions are
19 * met: redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer;
21 * redistributions in binary form must reproduce the above copyright

--- 78 unchanged lines hidden (view full) ---

100 { dependGraph[idx].inst = NULL; }
101
102 /** Removes an instruction from a single linked list. */
103 void remove(PhysRegIndex idx, DynInstPtr &inst_to_remove);
104
105 /** Removes and returns the newest dependent of a specific register. */
106 DynInstPtr pop(PhysRegIndex idx);
107
108 /** Checks if the entire dependency graph is empty. */
109 bool empty() const;
110
96 /** Checks if there are any dependents on a specific register. */
111 /** Checks if there are any dependents on a specific register. */
97 bool empty(PhysRegIndex idx) { return !dependGraph[idx].next; }
112 bool empty(PhysRegIndex idx) const { return !dependGraph[idx].next; }
98
99 /** Debugging function to dump out the dependency graph.
100 */
101 void dump();
102
103 private:
104 /** Array of linked lists. Each linked list is a list of all the
105 * instructions that depend upon a given register. The actual

--- 130 unchanged lines hidden (view full) ---

236 node->inst = NULL;
237 memAllocCounter--;
238 delete node;
239 }
240 return inst;
241}
242
243template <class DynInstPtr>
113
114 /** Debugging function to dump out the dependency graph.
115 */
116 void dump();
117
118 private:
119 /** Array of linked lists. Each linked list is a list of all the
120 * instructions that depend upon a given register. The actual

--- 130 unchanged lines hidden (view full) ---

251 node->inst = NULL;
252 memAllocCounter--;
253 delete node;
254 }
255 return inst;
256}
257
258template <class DynInstPtr>
259bool
260DependencyGraph<DynInstPtr>::empty() const
261{
262 for (int i = 0; i < numEntries; ++i) {
263 if (!empty(i))
264 return false;
265 }
266 return true;
267}
268
269template <class DynInstPtr>
244void
245DependencyGraph<DynInstPtr>::dump()
246{
247 DepEntry *curr;
248
249 for (int i = 0; i < numEntries; ++i)
250 {
251 curr = &dependGraph[i];

--- 21 unchanged lines hidden ---
270void
271DependencyGraph<DynInstPtr>::dump()
272{
273 DepEntry *curr;
274
275 for (int i = 0; i < numEntries; ++i)
276 {
277 curr = &dependGraph[i];

--- 21 unchanged lines hidden ---