[Patch] Add TargetLibraryInfo in LTO passes builder

Yi Jiang yjiang at apple.com
Mon Dec 9 15:52:34 PST 2013


Thank you for the clarification. Here is the patch with test case. 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lto.libinfo.patch
Type: application/octet-stream
Size: 1464 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131209/54c73329/attachment.obj>
-------------- next part --------------


On Dec 9, 2013, at 2:46 PM, "Duncan P. N. Exon Smith" <dexonsmith at apple.com> wrote:

> On Dec 9, 2013, at 2:24 PM, Yi Jiang <yjiang at apple.com> wrote:
> 
>> Hi Duncan,
>> 
>> Thank you for your information. However, I found the function body will be kept only we specify target triple = "x86_64-unknown-linux-gnu" in the source file. The function body will be cleaned up if we specify something like target triple = "x86_64-apple-darwin12.5.0".  It is the same behavior on  test/LTO/cfi_endproc.ll and my own test case, Do you know the reason? Thank you!
>> 
> 
> Different target triples name symbols differently.  You can probably use -exported-symbol=_foo.
> 
> Alternatively, you can append to @llvm.used [1].  This will allow -internalize to run, but will prevent -ipsccp and -globalopt from treating the functions as dead code.
> 
> [1]: http://llvm.org/docs/LangRef.html#the-llvm-used-global-variable
> 



More information about the llvm-commits mailing list