[LLVMdev] [lld] Representation of lld::Reference with a fake target

Rui Ueyama ruiu at google.com
Mon Feb 9 13:26:59 PST 2015


The atom model is, compared to the traditional linker model, representing
both symbol and its data as an "atom" and model relocations and other
information as edges between atoms.

I think the atom model doesn't mean nor require all atoms in memory are of
the same type (or class) regardless of architecture/OS. They can be
different subtype as long as output is correct. And that's what we are
doing with LLD. We have many subtypes of atoms or references. A reader for
an architecture creates atoms of some type, and the corresponding writer
for the architecture uses them. Architecture-independent passes work fine
with derived classes of atom/reference because subtypes have compatible
interface with super classes. It seems to be working, except the round-trip
test.

The round-trip test is different from other passes in the sense that it
needs to understand *everything* about given data (please compare this
property with other passes). It needs to be able to write everything about
a given (internal representation of) file and read them back. Otherwise we
will lose data during round-trip. That's what's happening, right?

The point is again we don't really need to save intermediate data. Only the
round-trip passes need to do that. The round-trip tests test the features
for themselves -- not for others. This is just a burden, no?

On Mon, Feb 9, 2015 at 1:05 PM, Shankar Easwaran <shankarke at gmail.com>
wrote:

>
>
> On Mon, Feb 9, 2015 at 2:30 PM, Rui Ueyama <ruiu at google.com> wrote:
>
>> On Mon, Feb 9, 2015 at 12:24 PM, Shankar Easwaran <
>> shankare at codeaurora.org> wrote:
>>
>>>  Hi,
>>>
>>> The round trip passes just tries to load a *complete* object file in
>>> YAML/Native format back.
>>>
>>> The internal state should be the complete object file in native/yaml
>>> format.
>>>
>>> If some state is not recorded and that is really needed in the writer,
>>> we should add that to the Atom model.
>>>
>>
>> Again, not only saying we should do something, but please elaborate why
>> you think we should. Otherwise we can't discuss...
>>
>
> The RoundTrip passes was a method to verify the Atom model. When the pass
> was written / reviewed, this pass was a way to verify that all information
> passed to the writer was passed through an Atom.
>
> I am completely ok to remove the pass as long as there is an alternative
> with which we can verify.
>
> Shankar Easwaran
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150209/a6d8f4f1/attachment.html>


More information about the llvm-dev mailing list