Srikant Bharadwaj has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/16668
Change subject: cpu: Fix indirect branch history updates
......................................................................
cpu: Fix indirect branch history updates
Recent changes to indirect branch predictor interface accesses
non-existent buffers even when idirect predictor is not in use.
Change-Id: I0df9ac4d5f6f3cb63e4d1bd36949c27f7611eef6
---
M src/cpu/pred/bpred_unit.cc
M src/cpu/pred/indirect.cc
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/src/cpu/pred/bpred_unit.cc b/src/cpu/pred/bpred_unit.cc
index a768cc1..2bfd901 100644
--- a/src/cpu/pred/bpred_unit.cc
+++ b/src/cpu/pred/bpred_unit.cc
@@ -371,7 +371,9 @@
// 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 @@
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) {
diff --git a/src/cpu/pred/indirect.cc b/src/cpu/pred/indirect.cc
index 6690abb..76fbc76 100644
--- a/src/cpu/pred/indirect.cc
+++ b/src/cpu/pred/indirect.cc
@@ -111,9 +111,11 @@
DPRINTF(Indirect, "Committing seq:%d\n", seq_num);
ThreadInfo &t_info = threadInfo[tid];
- // we do not need to recover the GHR, so delete the information
- unsigned * previousGhr = static_cast<unsigned *>(indirect_history);
- delete previousGhr;
+ if (indirect_history) {
+ // we do not need to recover the GHR, so delete the information
+ unsigned * previousGhr = static_cast<unsigned *>(indirect_history);
+ delete previousGhr;
+ }
if (t_info.pathHist.empty()) return;
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/16668
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I0df9ac4d5f6f3cb63e4d1bd36949c27f7611eef6
Gerrit-Change-Number: 16668
Gerrit-PatchSet: 1
Gerrit-Owner: Srikant Bharadwaj <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev