From: Gabe Black Date: Wed, 19 Aug 2020 03:46:45 +0000 (-0700) Subject: cpu: Don't construct and then copy the decoder in SimpleThread. X-Git-Tag: v20.1.0.0~277 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6add4fbc12d848fff6fae33cf0fcd9df063f1b62;p=gem5.git 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 --- 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);