Hacker News new | past | comments | ask | show | jobs | submit login

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”.




It 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.


There’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.


IPA is quite fiddly, an older or more eager compiler could remove the call by inlining then doing interprocedural optimization




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: