[LLVMdev] Any mechanism available for link time inlineing?

Nick Lewycky
Sun, 15 Feb 2015 04:25:44 -0000

mobi phil wrote:
> thanks, sounds great, heard about llvm-lto, but was not following in
> details. I have an llvm-lto in my dev branch build....now what I do not
> find are some example on how to use it for link time inline-ing. In
> worst case have to deal with the overhead to experiment

With what linker?

LLVM LTO is available by default with Apple's XCode development
environment, just specify -O4.

For linux or similar, see llvm.org/docs/GoldPlugin.html . You may be
able to just use -O4 on linux too, depending on how your llvm and linker
are installed, and assuming you run "clang" for your link steps.

Inlining occurs because it's a standard part of the link time
optimization pipeline. If you need to turn off the rest of LTO, reducing
it down to only inlining, that would take more work.

Nick