From 2db021b27bd4beb4828451fe57f6aa55de6b74b5 Mon Sep 17 00:00:00 2001 From: Erin Le Date: Fri, 2 Aug 2024 21:11:02 +0000 Subject: [PATCH] mem: Comment removal and adding constexpr to is_secure bools This commit removes some comments and adds constexpr in front of "bool is_secure..." in pif.cc, signature_path.cc, and signature_path_v2.cc Change-Id: Icafe1d7c97d1d3fbf6abc12ba87ebb596255b96f --- src/mem/cache/prefetch/associative_set.hh | 2 -- src/mem/cache/prefetch/pif.cc | 2 +- src/mem/cache/prefetch/signature_path.cc | 2 +- src/mem/cache/prefetch/signature_path_v2.cc | 3 +-- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/mem/cache/prefetch/associative_set.hh b/src/mem/cache/prefetch/associative_set.hh index f7217a1e6b..d434a6b47c 100644 --- a/src/mem/cache/prefetch/associative_set.hh +++ b/src/mem/cache/prefetch/associative_set.hh @@ -90,8 +90,6 @@ class AssociativeSet : public AssociativeCache using AssociativeCache::accessEntryByAddr; using AssociativeCache::findEntry; using AssociativeCache::insertEntry; - // using AssociativeCache::getPossibleEntries; - using AssociativeCache::replPolicy; using AssociativeCache::indexingPolicy; }; diff --git a/src/mem/cache/prefetch/pif.cc b/src/mem/cache/prefetch/pif.cc index 416190e2d3..6d62910452 100644 --- a/src/mem/cache/prefetch/pif.cc +++ b/src/mem/cache/prefetch/pif.cc @@ -176,7 +176,7 @@ PIF::notifyRetiredInst(const Addr pc) // Insert the spatial entry into the history buffer and update // the 'iterator' table to point to the new entry historyBuffer.push_back(spatialCompactor); - bool is_secure = false; + constexpr bool is_secure = false; auto idx_entry = index.findEntry(spatialCompactor.trigger, is_secure); if (idx_entry != nullptr) { diff --git a/src/mem/cache/prefetch/signature_path.cc b/src/mem/cache/prefetch/signature_path.cc index a16931828f..7f2f8b4794 100644 --- a/src/mem/cache/prefetch/signature_path.cc +++ b/src/mem/cache/prefetch/signature_path.cc @@ -192,7 +192,7 @@ SignaturePath::getSignatureEntry(Addr ppn, bool is_secure, SignaturePath::PatternEntry & SignaturePath::getPatternEntry(Addr signature) { - bool is_secure = false; + constexpr bool is_secure = false; PatternEntry* pattern_entry = patternTable.findEntry(signature, is_secure); if (pattern_entry != nullptr) { // Signature found diff --git a/src/mem/cache/prefetch/signature_path_v2.cc b/src/mem/cache/prefetch/signature_path_v2.cc index dc34dbd71e..d021170742 100644 --- a/src/mem/cache/prefetch/signature_path_v2.cc +++ b/src/mem/cache/prefetch/signature_path_v2.cc @@ -124,8 +124,7 @@ SignaturePathV2::handlePageCrossingLookahead(signature_t signature, // of them are unique, there are never "hits" in the GHR GlobalHistoryEntry *gh_entry = globalHistoryRegister.findVictim(0); assert(gh_entry != nullptr); - // Any address value works, as it is never used - bool is_secure = false; + constexpr bool is_secure = false; globalHistoryRegister.insertEntry(0, is_secure, gh_entry); // false, gh_entry->signature = signature;