diff options
author | Srikant Bharadwaj <srikant.bharadwaj@amd.com> | 2019-02-26 14:44:40 -0500 |
---|---|---|
committer | Srikant Bharadwaj <srikant.bharadwaj@amd.com> | 2019-02-26 19:52:43 +0000 |
commit | ae233c7723caf0c441e251883d887c98134e0482 (patch) | |
tree | 8b0f99af26be5b6f7410ab40d5012ab967845434 /src/cpu/pred | |
parent | 8e723650586e9d902d4b462ddf5bb067e5eb0757 (diff) | |
download | gem5-ae233c7723caf0c441e251883d887c98134e0482.tar.xz |
cpu: Fix indirect branch history updates
Recent changes to indirect branch predictor interface accesses
non-existent buffers even when indirect predictor is not in use.
Change-Id: I0df9ac4d5f6f3cb63e4d1bd36949c27f7611eef6
Reviewed-on: https://gem5-review.googlesource.com/c/16668
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Diffstat (limited to 'src/cpu/pred')
-rw-r--r-- | src/cpu/pred/bpred_unit.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/cpu/pred/bpred_unit.cc b/src/cpu/pred/bpred_unit.cc index a768cc19e..2bfd90140 100644 --- a/src/cpu/pred/bpred_unit.cc +++ b/src/cpu/pred/bpred_unit.cc @@ -371,7 +371,9 @@ BPredUnit::squash(const InstSeqNum &squashed_sn, ThreadID tid) // This call should delete the bpHistory. squash(tid, pred_hist.front().bpHistory); - iPred.deleteDirectionInfo(tid, pred_hist.front().indirectHistory); + if (useIndirect) { + iPred.deleteDirectionInfo(tid, pred_hist.front().indirectHistory); + } DPRINTF(Branch, "[tid:%i]: Removing history for [sn:%i] " "PC %s.\n", tid, pred_hist.front().seqNum, @@ -452,8 +454,10 @@ BPredUnit::squash(const InstSeqNum &squashed_sn, pred_hist.front().bpHistory, true, pred_hist.front().inst, corrTarget.instAddr()); - iPred.changeDirectionPrediction(tid, pred_hist.front().indirectHistory, - actually_taken); + if (useIndirect) { + iPred.changeDirectionPrediction(tid, + pred_hist.front().indirectHistory, actually_taken); + } if (actually_taken) { if (hist_it->wasReturn && !hist_it->usedRAS) { |