<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 19, 2016 at 11:49 AM, H.J. Lu <span dir="ltr"><<a href="mailto:hjl.tools@gmail.com" target="_blank">hjl.tools@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5">On Wed, Aug 17, 2016 at 6:08 PM, Teresa Johnson via llvm-commits<br>
<<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
> Author: tejohnson<br>
> Date: Wed Aug 17 20:08:50 2016<br>
> New Revision: 279023<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=279023&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=279023&view=rev</a><br>
> Log:<br>
> [ThinLTO] Keep common symbols in ThinLTO modules<br>
><br>
> Summary:<br>
> Skip the merging of common symbols for ThinLTO modules, they will be<br>
> merged by the final native object link. Trying to merge the symbols and<br>
> add to a combined module will incorrectly enable the common symbol to be<br>
> internalized in the ThinLTO module. Additionally, we will not want to<br>
> create a combined module for ThinLTO distributed builds.<br>
><br>
> This fixes failures in 7 cpu2006 benchmarks from the new LTO API in<br>
> ThinLTO mode.<br>
><br>
> Reviewers: mehdi_amini<br>
><br>
> Subscribers: pcc, llvm-commits, mehdi_amini<br>
><br>
> Differential Revision: <a href="https://reviews.llvm.org/D23637" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D23637</a><br>
><br>
> Added:<br>
>     llvm/trunk/test/tools/gold/<wbr>X86/Inputs/common_thinlto.ll<br>
>     llvm/trunk/test/tools/gold/<wbr>X86/common_thinlto.ll<br>
> Modified:<br>
>     llvm/trunk/include/llvm/LTO/<wbr>LTO.h<br>
>     llvm/trunk/tools/gold/gold-<wbr>plugin.cpp<br>
><br>
<br>
</div></div><span class="gmail-">> --- llvm/trunk/test/tools/gold/<wbr>X86/common_thinlto.ll (added)<br>
> +++ llvm/trunk/test/tools/gold/<wbr>X86/common_thinlto.ll Wed Aug 17 20:08:50 2016<br>
> @@ -0,0 +1,38 @@<br>
> +; RUN: opt -module-summary %s -o %t1.o<br>
> +; RUN: opt -module-summary %p/Inputs/common_thinlto.ll -o %t2.o<br>
> +<br>
> +; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \<br>
> +; RUN:    --plugin-opt=save-temps \<br>
> +; RUN:    --plugin-opt=thinlto \<br>
<br>
</span>"-m elf_x86_64" is missing here.<br></blockquote><div><br></div><div>Fixed in r279355.</div><div><br></div><div>Teresa</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<div class="gmail-HOEnZb"><div class="gmail-h5"><br>
> +; RUN:    -shared %t1.o %t2.o -o %t3<br>
> +<br>
> +; RUN: llvm-dis %t1.o.2.internalize.bc -o - | FileCheck %s --check-prefix=INTERNALIZE<br>
> +; We should not have internalized P, and it should still be common.<br>
> +; INTERNALIZE: @P = common global<br>
> +<br>
> +; RUN: llvm-dis %t1.o.4.opt.bc -o - | FileCheck %s --check-prefix=OPT<br>
> +; bar should still exist (if we had internalized P it would look dead).<br>
> +; OPT: @bar<br>
> +<br>
> +; RUN: llvm-nm %t3.o | FileCheck %s --check-prefix=NM<br>
> +; NM: bar<br>
> +<br>
> +source_filename = "common1.c"<br>
> +target datalayout = "e-m:e-i64:64-f80:128-n8:16:<wbr>32:64-S128"<br>
> +target triple = "x86_64-unknown-linux-gnu"<br>
> +<br>
> +@P = common global i8* (...)* null, align 8<br>
> +<br>
> +define i32 @main() {<br>
> +entry:<br>
> +  store i8* (...)* bitcast (i8* ()* @bar to i8* (...)*), i8* (...)** @P, align 8<br>
> +  %call = call i32 (...) @foo()<br>
> +  ret i32 0<br>
> +}<br>
> +<br>
> +declare i32 @foo(...)<br>
> +<br>
> +define internal i8* @bar() {<br>
> +entry:<br>
> +  ret i8* null<br>
> +}<br>
><br>
<br>
<br>
</div></div><span class="gmail-HOEnZb"><font color="#888888">--<br>
H.J.<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><span style="font-family:times;font-size:medium"><table cellspacing="0" cellpadding="0"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small"><td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Teresa Johnson |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a> |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"> 408-460-2413</td></tr></tbody></table></span></div>
</div></div>