diff -r 842f56345a42 -r 6a7ea4d860fc src/cpu/pred/tournament.hh --- a/src/cpu/pred/tournament.hh Fri Aug 21 07:03:27 2015 -0400 +++ b/src/cpu/pred/tournament.hh Sat Aug 22 10:36:31 2015 -0400 @@ -167,6 +167,7 @@ static int newCount; #endif unsigned globalHistory; + unsigned localHistoryIdx; unsigned localHistory; bool localPredTaken; bool globalPredTaken; diff -r 842f56345a42 -r 6a7ea4d860fc src/cpu/pred/tournament.cc --- a/src/cpu/pred/tournament.cc Fri Aug 21 07:03:27 2015 -0400 +++ b/src/cpu/pred/tournament.cc Sat Aug 22 10:36:31 2015 -0400 @@ -217,6 +217,7 @@ history->localPredTaken = local_prediction; history->globalPredTaken = global_prediction; history->globalUsed = choice_prediction; + history->localHistoryIdx = local_history_idx; history->localHistory = local_predictor_idx; bp_history = (void *)history; @@ -256,6 +257,7 @@ history->localPredTaken = true; history->globalPredTaken = true; history->globalUsed = true; + history->localHistoryIdx = invalidPredictorIndex; history->localHistory = invalidPredictorIndex; bp_history = static_cast(history); @@ -370,6 +372,12 @@ // Restore global history to state prior to this branch. globalHistory = history->globalHistory; + + // Restore local history + if (history->localHistoryIdx != invalidPredictorIndex) + { + localHistoryTable[history->localHistoryIdx] = history->localHistory; + } // Delete this BPHistory now that we're done with it. delete history;