2 ms·
Many of these cases are things the compiler doesn’t consider inlining even if the author does. Deleting a call that always returns 0 is a different optimizatio
by astrange 4y ago
Many of these cases are things the compiler doesn’t consider inlining even if the author does.
Deleting a call that always returns 0 is a different optimization called “interprocedural constant propagation”.
- mhh__ 4y agoIPA is quite fiddly, an older or more eager compiler could remove the call by inlining then doing interprocedural optimization
- nmilo 4y agoIt doesn't really matter what the compiler people classify as different kinds of optimizations. If the function call is gone, it's inlined. From a user standpoint I don't really care if it's not technically considered an "inline" by the gcc team.
- astrange 4y agoThere’s other differences - inlining often has a tradeoff where it increases program sizes or compile time but may make things faster. The other ones replace the call but don’t do that, so might be considered safer.