[ThinLTO][gold] Fix filenaming scheme for tasks.
authorHongtao Yu <hoy@fb.com>
Fri, 5 Feb 2021 21:17:51 +0000 (13:17 -0800)
committerHongtao Yu <hoy@fb.com>
Fri, 12 Feb 2021 17:40:08 +0000 (09:40 -0800)
commit0b1914e83a03be926569892c17ca743c5ea46d1f
tree0f7f1bc981e177c2cfd5c53fa71abe0e4dc9f153
parent66900b3eae96b295cc7eb9468680085028f35daa
[ThinLTO][gold] Fix filenaming scheme for tasks.

The gold LTO plugin uses a set of hooks to implements emit-llvm and capture intermediate file generated during LTO. The hooks are called by each lto backend thread with a taskID as argument to differentiate between threads and tasks. Currently, all threads are overwriting the same file which results into only the intermediate output of the last backend thread to be preserved. This diff encodes the taskID into the filename.

Reviewed By: tejohnson, wenlei

Differential Revision: https://reviews.llvm.org/D96173
llvm/test/tools/gold/X86/Inputs/emit-llvm.bar.ll [new file with mode: 0644]
llvm/test/tools/gold/X86/Inputs/emit-llvm.foo.ll [new file with mode: 0644]
llvm/test/tools/gold/X86/thinlto-emit-llvm.ll [new file with mode: 0644]
llvm/tools/gold/gold-plugin.cpp