Link Time Optimization (LTO)
The Link Time Optimization (LTO) feature is supported in IBM® Open XL C/C++ for AIX® 17.1.0.
The LTO information generated by IBM Open XL C/C++ for AIX
17.1.0 is
incompatible with the Interprocedural Analysis (IPA) information of IBM XL C/C++ for AIX
16.1.0 in the
following aspects:
- The IPA information in object files that are created by IBM XL C/C++ for AIX 16.1.0 or earlier releases is silently ignored by IBM Open XL C/C++ for AIX 17.1.0.
- Object files that are created by IBM XL C/C++ for AIX 16.1.0 or earlier releases using the -qipa=noobject option contain only IPA information, so they are unusable in IBM Open XL C/C++ for AIX 17.1.0.
- Object files that are created by IBM Open XL C/C++ for AIX
17.1.0 using the
-flto option are not
readable by IBM XL C/C++ for AIX
16.1.0 or earlier
releases.Note: In IBM Open XL C/C++ for AIX 17.1.0, the -flto=thin option is not supported. LTO mode can be set only to the full mode.
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.
Note: The minimum version of
libLTO.so that is supported by the linker is
version 29.