[llvm-dev] Lazily Loaded Modules and Linker::LinkOnlyNeeded

Rafael EspĂ­ndola via llvm-dev llvm-dev at lists.llvm.org
Wed Apr 20 12:28:23 PDT 2016


>
>
> I understood from his description that he reversed the destination and
> source so that destination is the user code.
> I assumed it was not lazy loaded, but that would explain the question then
> :)
>
> Neil: can you clarify? If Teresa is right, why aren't you materializing
> the destination module entirely?
>
>

I don't think it has ever been tried to use a lazy destination. Having said
that, I don't think isMaterializable should return true for a declaration.


> Even materializing functions from the source module on the fly isn't
> supported right now, is it?
>
>
It is.

Neil, the flag is linked to llvm-link's -only-needed command line option.
At least for simple cases it seems to be working. Given

declare void @g()
define void @f() {
  call void @g()
  ret void
}

and

define void @g() {
  ret void
}
define void @h() {
  ret void
}


linking with "llvm-link -only-needed test1.bc test2.bc" will bring in g,
but not h. Can you write a testcase showing what you were expecting it to
do but it is not?

Cheers,
Rafael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160420/8a762cfa/attachment.html>


More information about the llvm-dev mailing list