[PATCH] D43199: [IRMover] Implement name based structure type mapping

Evgeny Leviant via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 14 08:45:52 PST 2018


Actually I can't understand this:

>  it should scan its types so that Foo is found to be isomorphic to Bar an not imported.

imagine I have destination module A having this:
struct Bar { ... };
struct Foo { ... }; // isomorphic to Bar

Now I'm importing this from module B:
struct Foo { ... }; // same as in A
struct Baz {
   int i;
   Foo F;
};

I need to associate type instance of 'Foo' in module B to some type instance in module A in order
to copy `Foo F` from B to A.
Let's assume that after scanning types in module A, I do now that Foo and Bar are isomorphic
What should I do? (at the moment I'm checking names)

________________________________________
От: Rafael Avila de Espindola <rafael.espindola at gmail.com>
Отправлено: 14 февраля 2018 г. 19:20
Кому: Evgeny Leviant; reviews+D43199+public+9fc6d07c4d39554e at reviews.llvm.org; Eugene Leviant via Phabricator; joker.eph at gmail.com; tejohnson at google.com
Копия: George Rimar; llvm-commits at lists.llvm.org
Тема: Re: [PATCH] D43199: [IRMover] Implement name based structure type mapping

Evgeny Leviant <eleviant at accesssoftek.com> writes:

>> This suggests that ThinLTO should be changed. It is fine to start with a
>> non empty module, but it should scan its types so that Foo is found to
>> be isomorphic to Bar an not imported.
>
> I don't see how this can be done as you can have both Foo and Bar imported from different modules and still get mapping failure.
> The problem is that addNonOpaque registers a single entry for all isomorphic structure types. Can you please elaborate your idea?

I am not sure I follow. If they are imported from different modules we
are in the same situation as llvm-link, no? Importing two modules into a
third one.

Cheers,
Rafael


More information about the llvm-commits mailing list