[PATCH] D138560: [lld][LTO] Add assembly output to LTO save-temps

Yaxun Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 25 08:31:18 PST 2022


yaxunl added a comment.

In D138560#3950141 <https://reviews.llvm.org/D138560#3950141>, @MaskRay wrote:

> I am unsure I am convinced with the motivation. Say you have two bitcode files a.o and b.o, can you just use `clang++ -fuse-ld=lld a.o b.o -Wl,--lto-emit-asm`? This can be used with `-Wl,--save-temps` as well. The output is named in term of the `-o` output file name, instead of `*.s`, but the slight difference doesn't warrant adding significant more complexity to LTOBackend.cpp as this patch does.

We use lld to do device LTO in the HIP toolchain. clang driver extracts device bitcode and passes them to lld. When -save-temps is used, clang driver adds -save-temps to the options passed to lld. It is not convenient for the users to rerun lld command to get the assembly. It is better for lld to generate the assembly when -save-temps is used because: 1. it avoids redundant work, especially device LTO is usually the most time-consuming part 2. to keep the temporary file names consistent 3. it is a useful feature for lld itself


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138560/new/

https://reviews.llvm.org/D138560



More information about the llvm-commits mailing list