Bug 3793 – Functions with static arrays as arguments are not inlined

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-02-11T07:34:00Z
Last change time
2014-02-15T02:44:29Z
Keywords
performance
Assigned to
nobody
Creator
eriatarka84

Comments

Comment #0 by eriatarka84 — 2010-02-11T07:34:57Z
Was just browsing through some front end code and found this bit of code in canInline() in inline.c: /* If any parameters are Tsarray's (which are passed by reference) * or out parameters (also passed by reference), don't do inlining. */ if (parameters) { for (int i = 0; i < parameters->dim; i++) { VarDeclaration *v = (VarDeclaration *)parameters->data[i]; if (v->isOut() || v->isRef() || v->type->toBasetype()->ty == Tsarray) goto Lno; } } The comment, as far as I can see, is obsolete since static arrays are now value types? Perhaps this restriction can be lifted now? Especially for functions on small vectors, I would expect inlining to be very beneficial. Just putting this here to have it not overlooked.
Comment #1 by eriatarka84 — 2010-06-09T02:12:59Z
Seems to have been fixed in Changeset [497].