-
Notifications
You must be signed in to change notification settings - Fork 543
Open
Description
In #1564 we disabled LTO if linker-plugin-lto is not passed in to fix compilation on certain environment.
We could reclaim back the performance, by doing a c/c++ library internal LTO, similar to rustc's crate internal LTO.
To find these tools, we might want 'clang -print-resource-dir', or combined with env var lookup LLVM_INSTALL_DIR
We should also allow build script to override lto mode.
Did some research, for clang it seems to support this
llvm-link file1.bc file2.bc file3.bc -o merged.bc
llc merged.bc -filetype=obj -o merged.o
I didn't find anyway to achieve that for gcc.Ok so the opt command from llvm can actually do the optimization, might worth trying to see if it works.
We could do
llvm-link file1.bc file2.bc file3.bc -o merged.bc
opt -O{level} merged.bc
llc merged.bc -filetype=obj -o merged.o
Metadata
Metadata
Assignees
Labels
No labels