|
|
|
|
|
by JonChesterfield
1446 days ago
|
|
Provocative title. Function inlining mixes up call overhead elision and specialisation to the call site, especially if the compiler hasn't implemented the specialisation as it's own thing. Inlining by itself only decreases code size if there's provably a single call site. What's doing the work here is branch folding after the inline. Alternative is specialising the function wrt the predicate and rewriting call sites to the specialisation when the predicate is known. Harder than inline branchy things and hope for the best but tractable and bounds the code size increase. |
|