[llvm-dev] llvm-link unifies identified structs?

Duncan P. N. Exon Smith via llvm-dev llvm-dev at lists.llvm.org
Mon Aug 1 18:37:23 PDT 2016


Rafael knows the most about linking types.

IIUC, it's intentional that types such as these get merged at link time.  LangRef must be referring to pass pipelines and (de-)serialization.  Maybe you could put together a patch to make it more clear?

I imagine, once type-less pointers are finished, we might start uniquing identified types in all cases.

> On 2016-Jul-30, at 11:23, Robin Sommer via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> Any suggestions? It's not a problem for me, I'm mostly curious as it
> makes it harder to read the IR. Feel free to point me to other
> documentation if I'm missing something. Thanks,
> 
> Robin
> 
> On Wed, Jul 27, 2016 at 08:10 -0700, I wrote:
> 
>> The language reference says: "identified [structure] types are never
>> uniqued". But llvm-link seems to do just that at link-time:
>> 
>>> cat x.ll
>> 
>>    %A = type {}
>>    %B = type {}
>>    %C = type { %A*, %B* }
>> 
>>    define void @foo(%C* %c) {
>>      ret void
>>    }
>> 
>>> llvm-link x.ll | llvm-dis
>>    ; ModuleID = '<stdin>'
>>    source_filename = "llvm-link"
>> 
>>    %C = type { %A*, %A* }
>>    %A = type {}
>> 
>>    define void @foo(%C* %c) {
>>        ret void
>>    }
>> 
>> Does the statement in the language reference not apply to linking?
>> 
>> (This is with a recent 3.9).
>> 
>> Robin
>> 
>> -- 
>> Robin Sommer * ICSI/LBNL * robin at icir.org * www.icir.org/robin
> 
> 
> -- 
> Robin Sommer * ICSI/LBNL * robin at icir.org * www.icir.org/robin
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



More information about the llvm-dev mailing list