Link Time Optimization (LTO)
The Link Time Optimization (LTO) feature is supported in IBM® Open XL C/C++ for Linux® on Power® 17.1.1.
The LTO information generated by IBM Open XL C/C++ for Linux on Power
17.1.1 is
incompatible with the Interprocedural Analysis (IPA) information of IBM XL C/C++ for Linux 16.1.1 in the
following aspects:
- The IPA information in object files that are created by IBM XL C/C++ for Linux 16.1.1 or earlier releases is silently ignored by IBM Open XL C/C++ for Linux on Power 17.1.1.
- Object files that are created by IBM XL C/C++ for Linux 16.1.1 or earlier releases using the -qipa=noobject option contain only IPA information, so they are unusable in IBM Open XL C/C++ for Linux on Power 17.1.1.
- Object files that are created by IBM Open XL C/C++ for Linux on Power 17.1.1 using the -flto option are not readable by IBM XL C/C++ for Linux 16.1.1 or earlier releases.
To compile a program with LTO, specify the
-flto option on both the
compile and link steps:
- When -flto is specified on the compile step, the compiler generates LLVM IR instead of object code, in preparation for LTO on the link step.
- When -flto is
specified on the link step, the compiler adds extra linker options such as
-bplugin:<path-to-libLTO.so> when
invoking the linker. The linker can handle a mixture of native XCOFF objects and LLVM IR objects,
and then invokes the LTO optimizations on the
LLVM IR objects via the
libLTO.soplugin.