diff options
author | Nathan Binkert <binkertn@umich.edu> | 2006-12-20 22:20:11 -0800 |
---|---|---|
committer | Nathan Binkert <binkertn@umich.edu> | 2006-12-20 22:20:11 -0800 |
commit | 9aecfb3e3bfe1b85db9468bad287f22a2eb9bd4e (patch) | |
tree | d4b2cbff99ca89ea77011552ab5e57b2435b1326 /src/cpu/o3/rename_impl.hh | |
parent | 4b3538b609cfcce0891ee5ef7d690646a6030166 (diff) | |
download | gem5-9aecfb3e3bfe1b85db9468bad287f22a2eb9bd4e.tar.xz |
don't use (*activeThreads).begin(), use activeThreads->blah().
Also don't call (*activeThreads).end() over and over. Just
call activeThreads->end() once and save the result.
Make sure we always check that there are elements in the list
before we grab the first one.
--HG--
extra : convert_revision : d769d8ed52da99532d57a9bbc93e92ddf22b7e58
Diffstat (limited to 'src/cpu/o3/rename_impl.hh')
-rw-r--r-- | src/cpu/o3/rename_impl.hh | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/cpu/o3/rename_impl.hh b/src/cpu/o3/rename_impl.hh index 248d7deb6..3a8e503a0 100644 --- a/src/cpu/o3/rename_impl.hh +++ b/src/cpu/o3/rename_impl.hh @@ -412,10 +412,11 @@ DefaultRename<Impl>::tick() sortInsts(); - std::list<unsigned>::iterator threads = (*activeThreads).begin(); + std::list<unsigned>::iterator threads = activeThreads->begin(); + std::list<unsigned>::iterator end = activeThreads->end(); // Check stall and squash signals. - while (threads != (*activeThreads).end()) { + while (threads != end) { unsigned tid = *threads++; DPRINTF(Rename, "Processing [tid:%i]\n", tid); @@ -434,9 +435,9 @@ DefaultRename<Impl>::tick() cpu->activityThisCycle(); } - threads = (*activeThreads).begin(); + threads = activeThreads->begin(); - while (threads != (*activeThreads).end()) { + while (threads != end) { unsigned tid = *threads++; // If we committed this cycle then doneSeqNum will be > 0 @@ -764,10 +765,13 @@ template<class Impl> bool DefaultRename<Impl>::skidsEmpty() { - std::list<unsigned>::iterator threads = (*activeThreads).begin(); + std::list<unsigned>::iterator threads = activeThreads->begin(); + std::list<unsigned>::iterator end = activeThreads->end(); - while (threads != (*activeThreads).end()) { - if (!skidBuffer[*threads++].empty()) + while (threads != end) { + unsigned tid = *threads++; + + if (!skidBuffer[tid].empty()) return false; } @@ -780,11 +784,10 @@ DefaultRename<Impl>::updateStatus() { bool any_unblocking = false; - std::list<unsigned>::iterator threads = (*activeThreads).begin(); - - threads = (*activeThreads).begin(); + std::list<unsigned>::iterator threads = activeThreads->begin(); + std::list<unsigned>::iterator end = activeThreads->end(); - while (threads != (*activeThreads).end()) { + while (threads != end) { unsigned tid = *threads++; if (renameStatus[tid] == Unblocking) { |