cpu: split LTAGE implementation into a base TAGE and a derived LTAGE
[gem5.git] / src / cpu / pred / 2bit_local.cc
index 9e1c781c58b84031e6b543603c22387d1a72ce1c..cd97f2bdf587b7fdb7016999c45a2dcdce4a0397 100644 (file)
  * Authors: Kevin Lim
  */
 
+#include "cpu/pred/2bit_local.hh"
+
 #include "base/intmath.hh"
-#include "base/misc.hh"
+#include "base/logging.hh"
 #include "base/trace.hh"
-#include "cpu/pred/2bit_local.hh"
 #include "debug/Fetch.hh"
 
 LocalBP::LocalBP(const LocalBPParams *params)
@@ -123,6 +124,12 @@ LocalBP::update(ThreadID tid, Addr branch_addr, bool taken, void *bp_history,
     assert(bp_history == NULL);
     unsigned local_predictor_idx;
 
+    // No state to restore, and we do not update on the wrong
+    // path.
+    if (squashed) {
+        return;
+    }
+
     // Update the local predictor.
     local_predictor_idx = getLocalIndex(branch_addr);