Opened 13 years ago
Last modified 12 years ago
#1708 closed defect (fixed)
Strip unused functions from generated code
Reported by: | Martin Sjölund | Owned by: | Martin Sjölund |
---|---|---|---|
Priority: | normal | Milestone: | 1.9.0 |
Component: | Backend | Version: | |
Keywords: | Cc: | Martin Sjölund, Frenkel, TUD |
Description
In order to speed up code generation and compilation, the backend could remove all functions that can no longer be called after symbolic manipulation.
For example, MultiBody simulations contain a lot of functions that are inlined or compile-time evaluated expressions.
Change History (4)
comment:1 by , 13 years ago
comment:2 by , 13 years ago
If I had time, yes :)
I'd use a work list algorithm:
Create a new Function HashTable.
1) Find all paths called in the equations, add these to the work list
2) Pop the top of the work list, or stop
3) If not already visited, add function to the new function hashtable, add all called paths to the work list
4) Goto 2
comment:4 by , 12 years ago
Cc: | added; removed |
---|---|
Component: | → Backend |
Milestone: | → 1.9.0 |
This should not be to complicated.