From 6add4fbc12d848fff6fae33cf0fcd9df063f1b62 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Tue, 18 Aug 2020 20:46:45 -0700 Subject: [PATCH] cpu: Don't construct and then copy the decoder in SimpleThread. The SimpleThread constructor was constructing a temporary copy of the decoder, and then copying it into it's local version. This copy is a waste, and also requires there to be a copy operator for the Decoder. Change-Id: I1123b4ec767e08ceb2f108b3a6b19ca18d7c677c Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/32900 Reviewed-by: Andreas Sandberg Maintainer: Andreas Sandberg Tested-by: kokoro --- src/cpu/simple_thread.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cpu/simple_thread.cc b/src/cpu/simple_thread.cc index 1d2c0b837..7ed2e8279 100644 --- a/src/cpu/simple_thread.cc +++ b/src/cpu/simple_thread.cc @@ -72,7 +72,7 @@ SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys, isa(dynamic_cast(_isa)), predicate(true), memAccPredicate(true), comInstEventQueue("instruction-based event queue"), - system(_sys), itb(_itb), dtb(_dtb), decoder(TheISA::Decoder(isa)) + system(_sys), itb(_itb), dtb(_dtb), decoder(isa) { assert(isa); clearArchRegs(); @@ -84,7 +84,7 @@ SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys, isa(dynamic_cast(_isa)), predicate(true), memAccPredicate(true), comInstEventQueue("instruction-based event queue"), - system(_sys), itb(_itb), dtb(_dtb), decoder(TheISA::Decoder(isa)) + system(_sys), itb(_itb), dtb(_dtb), decoder(isa) { assert(isa); -- 2.30.2