arch: Use const StaticInstPtr references where possible
This patch optimises the passing of StaticInstPtr by avoiding copying the reference-counting pointer. This avoids first incrementing and then decrementing the reference-counting pointer.
This commit is contained in:
@@ -87,9 +87,9 @@ class BPredUnit : public SimObject
|
||||
* @param tid The thread id.
|
||||
* @return Returns if the branch is taken or not.
|
||||
*/
|
||||
bool predict(StaticInstPtr &inst, const InstSeqNum &seqNum,
|
||||
bool predict(const StaticInstPtr &inst, const InstSeqNum &seqNum,
|
||||
TheISA::PCState &pc, ThreadID tid);
|
||||
bool predictInOrder(StaticInstPtr &inst, const InstSeqNum &seqNum,
|
||||
bool predictInOrder(const StaticInstPtr &inst, const InstSeqNum &seqNum,
|
||||
int asid, TheISA::PCState &instPC,
|
||||
TheISA::PCState &predPC, ThreadID tid);
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ BPredUnit::drainSanityCheck() const
|
||||
}
|
||||
|
||||
bool
|
||||
BPredUnit::predict(StaticInstPtr &inst, const InstSeqNum &seqNum,
|
||||
BPredUnit::predict(const StaticInstPtr &inst, const InstSeqNum &seqNum,
|
||||
TheISA::PCState &pc, ThreadID tid)
|
||||
{
|
||||
// See if branch predictor predicts taken.
|
||||
@@ -244,7 +244,7 @@ BPredUnit::predict(StaticInstPtr &inst, const InstSeqNum &seqNum,
|
||||
}
|
||||
|
||||
bool
|
||||
BPredUnit::predictInOrder(StaticInstPtr &inst, const InstSeqNum &seqNum,
|
||||
BPredUnit::predictInOrder(const StaticInstPtr &inst, const InstSeqNum &seqNum,
|
||||
int asid, TheISA::PCState &instPC,
|
||||
TheISA::PCState &predPC, ThreadID tid)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user