<div dir="ltr">Hi Shankar,<br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 21, 2015 at 9:55 AM, Shankar Easwaran <span dir="ltr"><<a href="mailto:shankar.kalpathi.easwaran@gmail.com" target="_blank">shankar.kalpathi.easwaran@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">filcab,<br>
<br>
We need lld to be tightly integrated with LLVM targets, these are the reasons I have in mind :<br>
<br>
- targets need to get instruction eencoding recorded in the Td file. If you see the Hexagon target in lld we have one huge file that contains all the encodings which is just duplicating informattoo in the Td files. I believe MIPS also needs this encoding information.<br></blockquote><div>Is this about the code like what's in <a href="http://llvm.org/klaus/lld/blob/master/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp#L-54">http://llvm.org/klaus/lld/blob/master/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp#L-54</a> (and other files for other archs)?</div><div><br></div><div>From talking to Michael, I got the impression that it's such a small amount of code (that will basically never change), that it's not worth it to have lld depend on all the target infrastructure for no or very little gains.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
- enable better diagnostics with encoding information.<br></blockquote><div>What kinds of diagnostics, for what kinds of errors?</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
It's also needed in the future for LTO purposes to invoke the code generator from lld after reading bit code files.<br></blockquote><div>I don't understand this. lld should be able to use the lto library without caring about which targets are enabled (as long as lld can handle the triple it wants, of course). It's “just”: “here's bitcode. Give me machine code”. And then finish the link. No target things should leak out of the lto library. Or is this wrong?</div><div>The way I see it is: lld depends (directly) on the lto library. The lto library will depend on the targets, but lld won't depend on them directly.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I would like to propose LLD_TARGET_<flavor> as we have multiple flavors that may support the same target in future. Other proposals are welcome too.<br></blockquote><div>Doesn't sound bad to me :)</div><div><br></div><div>Thanks,</div><div><br></div><div> Filipe</div></div></div></div>