[LLVMbugs] [Bug 10190] New: The behaviour of Module::setDataLayout is not as expected.
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sat Jun 25 00:26:42 PDT 2011
http://llvm.org/bugs/show_bug.cgi?id=10190
Summary: The behaviour of Module::setDataLayout is not as
expected.
Product: new-bugs
Version: 2.9
Platform: PC
OS/Version: Windows NT
Status: NEW
Severity: normal
Priority: P
Component: new bugs
AssignedTo: unassignedbugs at nondot.org
ReportedBy: wuye9036 at gmail.com
CC: llvmbugs at cs.uiuc.edu
Created an attachment (id=6768)
--> (http://llvm.org/bugs/attachment.cgi?id=6768)
generated code. "Mvs_main@@QSVSIn@@" is the main function
Hi, guys,
Thans for your attention.
I found that the Module::setDataLayout did not works well.
If I set layout ( such as struct alignment ), it could not affect the data
layout of target machine.
An easiler sample as following:
void foo( struct{ <4 x float>, <4 x float> }* ptr ){
.entry:
second_member = load ptr[1] ; You know what i mean.
second_copy = alloca struct{ <4 x float>, <4 x float> ; no alignment
; // blah blah blah
add( another_vec4, second_copy ); // You know what i mean;
; // blah blah blah
}
And the mentioned code will generate asm (SSE on x86) as following:
; //blah blah blah
movups xmmword ptr[second_copy], xmm0 ; // unaligned memory access, it's right.
; //blah blah blah
addps xmm1, xmmword ptr[second_copy] ; // Here we need second_copy are 16 bytes
aligned.
But even if I set data layout as "s0:128:128", these code would crash since
unaligned access. if I create the alloca instruction with align 16, all is ok.
And I traced code and found that the data layout doesn't affect the TargetData
of JIT.
Could you help me, thanks.
And, another question I will ask is the difference between ABI alignment and
Preferred alignment.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list