Opened 8 years ago
#4131 new defect
Superfluous variables and parameters are part of the simulation
Reported by: | Martin Sjölund | Owned by: | Lennart Ochel |
---|---|---|---|
Priority: | critical | Milestone: | Future |
Component: | Backend | Version: | |
Keywords: | Cc: | Willi Braun, Lennart Ochel |
Description
The backend does not remove evaluated parameters from the simcode, keeping these variables as allocated. These parameters (possibly also variables?) are only needed for writing the simulation result file and should be stored separate from the parameters/vars arrays.
This would give us better data locality and for targets using -noemit (real-time / embedded simulations), it would also make the memory smaller. I just tried to evaluate all parameters when targeting AVR and got more variables stored than before (even though 0 of the 47 parameters were referenced in the simulation).
Similarly, algebraic non-output variables might not be interesting and should be possible to optimize away since they only take up space and computations. (Unused parameters are similar)