[llvm-commits] [llvm] r140902 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAG.cpp test/CodeGen/X86/alignment-2.ll
Bill Wendling
wendling at apple.com
Sat Oct 1 12:32:34 PDT 2011
On Oct 1, 2011, at 5:42 AM, Duncan Sands wrote:
>>>> 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.
>
Really? That sounds like a bug. If it changes the type from, say, a scalar to a vector, that's not good...
-bw
More information about the llvm-commits
mailing list