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

Evgeny Leviant via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 14 04:09:39 PST 2018


> Why do you need ThinLTO to test a type merging feature? Could this use
> llvm-link?

The specifics of thinlto import is that module is partially  imported to an existing module, while llvm-link imports all source modules to an empty destination module.
This causes differences in how structure types are processed: thinlto calls addNonOpaque for all structure types in non-empty destination module before 
actual import is started (see IRMover constructor) and llvm-link calls addNonOpaque(S) during import process when structure S is being imported to the destination
module. 

As a result structure Foo will not be imported at all if you use llvm-link, because it is isomorphic to previously declared Bar and all references to Foo
will be replaced by references to Bar in the destination module. This is cool, but I don't think it is usable for thinlto as we're doing partial link.

So to make long story short: I don't think llvm-link can be used to test this.
________________________________________
От: Rafael Avila de Espindola <rafael.espindola at gmail.com>
Отправлено: 13 февраля 2018 г. 18:47
Кому: reviews+D43199+public+9fc6d07c4d39554e at reviews.llvm.org; Eugene Leviant via Phabricator; Evgeny Leviant; 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

Eugene Leviant via Phabricator via llvm-commits
<llvm-commits at lists.llvm.org> writes:

> Index: test/ThinLTO/X86/struct-mapping.ll
> ===================================================================
> --- test/ThinLTO/X86/struct-mapping.ll
> +++ test/ThinLTO/X86/struct-mapping.ll
> @@ -0,0 +1,46 @@
> +; RUN: opt -module-summary %s -o %t1.bc
> +
> +; The output file name does matter, because it affetcs the function
> +; import order. This is the reason struct-mapping-foo.ll becomes %t3
> +; RUN: opt -module-summary %p/Inputs/struct-mapping-foo.ll -o %t3.bc
> +; RUN: opt -module-summary %p/Inputs/struct-mapping-baz.ll -o %t2.bc

Why do you need ThinLTO to test a type merging feature? Could this use
llvm-link?

Cheers,
Rafael


More information about the llvm-commits mailing list