I’m trying to incorporate thinLTO into our proprietary linker. I can’t seem to make it work at all (although I do have the ‘thick’ form working). When I try to invoke the ThinGenerator API it crashes somewhere way down in the bowels of IPO. So stepping away from the linker, I am just trying to explore the processing steps using standalone off-the shelf llvm built from tip-of-tree.
1. When I do ‘clang -c -flto=thin t1.c’ on a simple input file, the resulting .o file is a bitcode file as expected, but when I llvm-dis it there is no evidence of the module summary information. Is there a way to view the summary index for a given module?
2. When I take two or three .o files generated using -flto=thin and pass them to the standalone llvm-lto tool, as in:
llvm-lto --thinlto t2.o t3.o --exported-symbol=t2 -o index
the combined index is (apparently) empty.
3. When I take a program and pass all the .o files to llvm-lto --thinlto-action=run, I get recompiled .o files for each but there seems to be no IPO (no inlining, etc).
What am I missing?
-Alan
I’m trying to incorporate thinLTO into our proprietary linker. I can’t seem to make it work at all (although I do have the ‘thick’ form working).
When I try to invoke the ThinGenerator API it crashes somewhere way down in the bowels of IPO. So stepping away from the linker, I am just trying to explore the processing steps using standalone off-the shelf llvm built from tip-of-tree.
1. When I do ‘clang -c -flto=thin t1.c’ on a simple input file, the resulting .o file is a bitcode file as expected, but when I llvm-dis it there is no evidence of the module summary information. Is there a way to view the summary index for a given module?
2. When I take two or three .o files generated using -flto=thin and pass them to the standalone llvm-lto tool, as in:
llvm-lto --thinlto t2.o t3.o --exported-symbol=t2 -o index
the combined index is (apparently) empty.
3. When I take a program and pass all the .o files to llvm-lto --thinlto-action=run, I get recompiled .o files for each but there seems to be no IPO (no inlining, etc).
What am I missing?
-Alan
_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
| Teresa Johnson | | Software Engineer | | tejo...@google.com | | 408-460-2413 |
Teresa, thanks, that’s helpful.
I discovered the resolution-based API and am now converting to that. I can also see that the summaries are in the bitcode files, via llvm-bcanalyzer.
I hope the llvm-dis support will happen. Also it would be nice if the documentation were more up-to-date. But this will definitely help get me moving again.
For whatever reason in this simple example t3 is not being inlined, but I can set that aside for now.
// t2.c:
int t3();
int t2()
{
if (t3()) return 1;
else return 0;
}
// t3.c:
int t3()
{
return 10;
}
% clang -c -O2 -flto=thin t2.c t3.c
% llvm-lto t2.o t3.o --exported-symbol=t2 --thinlto-action=run -debug-only=function-import -thinlto-save-temps=.
Live root: 11079814748834529807
2 symbols Live, and 1 symbols Dead
Computing import for Module 't3.o'
Ignores Dead GUID: 8059958135287337232
Initialize import for 14314392591860533259
Computing import for Module 't2.o'
Initialize import for 11079814748834529807
Import/Export lists for 2 modules:
* Module t3.o exports 0 functions. Imports from 0 modules.
* Module t2.o exports 0 functions. Imports from 0 modules.
Starting import for Module t2.o
Imported 0 functions for Module t2.o
Starting import for Module t3.o
Imported 0 functions for Module t3.o
-Alan
Hi Alan,
For whatever reason in this simple example t3 is not being inlined, but I can set that aside for now.
// t2.c:
int t3();
-- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.