Is there a way to force an inline function in Clang/LLVM?
AFAIK, the following is just a hint to the compiler but it can ignore the request.
__attribute_
You can start with experimenting with: clang -mllvm -inline-threshold=n
The greater the parameter n, the more agressive the inlining will be. Default is 225 so set it to something bigger. Expect big code size and long compilation times with very agressive inlining. When you hit the point of diminishing returns you can try profiling the code and looking for frequently called but uninlined functions and try marking them with attribute((always_inline)) for even more inlining.
If you have functions marked "inline", you can also experiment with -inlinehint-threshold bigger than -inline-threshold and see whether this changes anything.
Also, are you compiling with link-time optimizations? Without them inlining is limited to individual compilation units.
**taken from groups.google.com forum