Gabe Black has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/30375 )

Change subject: cpu: Remove default argument values for the update() method in bpreds.
......................................................................

cpu: Remove default argument values for the update() method in bpreds.

These defaults are never used. There was an assert in the predictors
until recently which was asserting that one of the arguments didn't
have the default value, I think to verify that the default wasn't used
by accident(?), but it could be used purposefully. That would cause
gem5 to crash and has been removed.

Beyond that, there's no reason to have default values for those
arguments in the first place, so this change removes them. That makes
the code slightly simpler, and avoids them being used by accident.

Additionally, the defalt values of the arguments made the function
signatures inconsistent, even though they were supposed to override
each other.

JIRA: https://gem5.atlassian.net/browse/GEM5-483

Change-Id: I28f8d2048985c12ec9cac018a868a32bfa20dc6c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30375
Reviewed-by: Hsuan Hsu <hsuan....@mediatek.com>
Reviewed-by: Andreas Sandberg <andreas.sandb...@arm.com>
Maintainer: Gabe Black <gabebl...@google.com>
Maintainer: Andreas Sandberg <andreas.sandb...@arm.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/cpu/pred/bpred_unit.hh
M src/cpu/pred/ltage.hh
M src/cpu/pred/multiperspective_perceptron.hh
M src/cpu/pred/multiperspective_perceptron_tage.hh
M src/cpu/pred/tage.hh
M src/cpu/pred/tage_sc_l.hh
6 files changed, 6 insertions(+), 7 deletions(-)

Approvals:
  Andreas Sandberg: Looks good to me, approved; Looks good to me, approved
  Hsuan Hsu: Looks good to me, approved
  Gabe Black: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/cpu/pred/bpred_unit.hh b/src/cpu/pred/bpred_unit.hh
index c4dbad2..3ca6fa8 100644
--- a/src/cpu/pred/bpred_unit.hh
+++ b/src/cpu/pred/bpred_unit.hh
@@ -177,8 +177,7 @@
      */
     virtual void update(ThreadID tid, Addr instPC, bool taken,
                    void *bp_history, bool squashed,
- const StaticInstPtr & inst = StaticInst::nullStaticInstPtr,
-                   Addr corrTarget = MaxAddr) = 0;
+                   const StaticInstPtr &inst, Addr corrTarget) = 0;
     /**
      * Updates the BTB with the target of a branch.
      * @param inst_PC The branch's PC that will be updated.
diff --git a/src/cpu/pred/ltage.hh b/src/cpu/pred/ltage.hh
index 53081da..0bbac81 100644
--- a/src/cpu/pred/ltage.hh
+++ b/src/cpu/pred/ltage.hh
@@ -66,7 +66,7 @@
     void squash(ThreadID tid, void *bp_history) override;
void update(ThreadID tid, Addr branch_addr, bool taken, void *bp_history,
                 bool squashed, const StaticInstPtr & inst,
-                Addr corrTarget = MaxAddr) override;
+                Addr corrTarget) override;

     void init() override;
     virtual void regStats() override;
diff --git a/src/cpu/pred/multiperspective_perceptron.hh b/src/cpu/pred/multiperspective_perceptron.hh
index 9d45032..c225aa4 100644
--- a/src/cpu/pred/multiperspective_perceptron.hh
+++ b/src/cpu/pred/multiperspective_perceptron.hh
@@ -1029,7 +1029,7 @@
     void update(ThreadID tid, Addr instPC, bool taken,
             void *bp_history, bool squashed,
             const StaticInstPtr & inst,
-            Addr corrTarget = MaxAddr) override;
+            Addr corrTarget) override;
void btbUpdate(ThreadID tid, Addr branch_addr, void* &bp_history) override;
 };
 #endif//__CPU_PRED_MULTIPERSPECTIVE_PERCEPTRON_HH__
diff --git a/src/cpu/pred/multiperspective_perceptron_tage.hh b/src/cpu/pred/multiperspective_perceptron_tage.hh
index b18774e..366f7b8 100644
--- a/src/cpu/pred/multiperspective_perceptron_tage.hh
+++ b/src/cpu/pred/multiperspective_perceptron_tage.hh
@@ -228,7 +228,7 @@
     void update(ThreadID tid, Addr instPC, bool taken,
             void *bp_history, bool squashed,
             const StaticInstPtr & inst,
-            Addr corrTarget = MaxAddr) override;
+            Addr corrTarget) override;
     void uncondBranch(ThreadID tid, Addr pc, void * &bp_history) override;
     void squash(ThreadID tid, void *bp_history) override;

diff --git a/src/cpu/pred/tage.hh b/src/cpu/pred/tage.hh
index a585717..b32ce67 100644
--- a/src/cpu/pred/tage.hh
+++ b/src/cpu/pred/tage.hh
@@ -85,7 +85,7 @@
void btbUpdate(ThreadID tid, Addr branch_addr, void* &bp_history) override; void update(ThreadID tid, Addr branch_addr, bool taken, void *bp_history,
                 bool squashed, const StaticInstPtr & inst,
-                Addr corrTarget = MaxAddr) override;
+                Addr corrTarget) override;
     virtual void squash(ThreadID tid, void *bp_history) override;
 };

diff --git a/src/cpu/pred/tage_sc_l.hh b/src/cpu/pred/tage_sc_l.hh
index b3629ab..71f9c17 100644
--- a/src/cpu/pred/tage_sc_l.hh
+++ b/src/cpu/pred/tage_sc_l.hh
@@ -158,7 +158,7 @@

void update(ThreadID tid, Addr branch_addr, bool taken, void *bp_history,
                 bool squashed, const StaticInstPtr & inst,
-                Addr corrTarget = MaxAddr) override;
+                Addr corrTarget) override;

   protected:


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/30375
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I28f8d2048985c12ec9cac018a868a32bfa20dc6c
Gerrit-Change-Number: 30375
Gerrit-PatchSet: 3
Gerrit-Owner: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-Reviewer: Bradford Beckmann <brad.beckm...@amd.com>
Gerrit-Reviewer: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Hsuan Hsu <hsuan....@mediatek.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to