[llvm-commits] [llvm] r140902 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAG.cpp test/CodeGen/X86/alignment-2.ll
Duncan Sands
baldrick at free.fr
Sat Oct 1 05:42:42 PDT 2011
Hi Bill,
>>> When inferring the pointer alignment, if the global doesn't have an initializer
>>> and the alignment is 0 (i.e., it's defined globally in one file and declared in
>>> another file) it could get an alignment which is larger than the ABI allows for
>>> that type, resulting in aligned moves being used for unaligned loads.
>>
>> even if it has an initializer that doesn't mean anything if the global has a
>> weak linkage type since in the final program a different initializer might be
>> used. In short, the code a line or so above should use hasDefinitiveInitializer
>> not hasInitializer.
>>
> Does that matter in this case? It's just trying to see if there's a preferred alignment, which from what I can tell relies upon the type and not the initializer. If I read this correctly, the presence of an initializer is what's important here.
the type could be different in a different translation unit, so yes it
does matter.
Ciao, Duncan.
More information about the llvm-commits
mailing list