[PATCH] D14623: [ThinLTO] Comdat importing fixes and related cleanup

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 30 13:17:41 PST 2015


On Mon, Nov 30, 2015 at 1:11 PM, Rafael EspĂ­ndola
<rafael.espindola at gmail.com> wrote:
>> Not exactly, f2 can't be imported as-is since that would result in
>> multiply-defined f2. To avoid that, f2() is imported as
>> available_externally. Unfortunately, with the change you made in
>> r254170 we cannot import f() as an alias of the imported f2. It needs
>> to be a declaration. That may be an issue if f and f2 are part of a
>> comdat, where we decided to select and therefore import the source
>> comdat group - it will be incomplete.
>
> You can't have f2 be available_externally and part of comdat:
>
> $f2 = comdat any
> define available_externally void @f2() comdat {
>   ret void
> }
>
> will fail the verifier:
>
> Declaration may not be in a Comdat!
> void ()* @f2

Right, which is why I have stripDeclsFromComdats() in this patch (see
the header comments for that new routine). Forgot about that, so I
think the issue with the change made in r254170 interacting badly with
comdat groups is not an issue. So the main thing is that what we want
here is for the alias to become a decl in the importing module, which
happens during global value proto linking at head and as a post-pass
after lazy linking in this patch.

Teresa

>
>
> Cheers,
> Rafael



-- 
Teresa Johnson | Software Engineer | tejohnson at google.com | 408-460-2413


More information about the llvm-commits mailing list