[llvm-commits] Fix bug 11719 - Vector Alignment Is not Defined for Small Size Vector for Clang Vector Extension on ARM

Yin Ma yinma at codeaurora.org
Fri Jan 6 13:21:19 PST 2012


Hello, 

 

LLVM/Clang supports Vector Extensions. But it doesn't give the definition
for 

vector type which size is smaller than 64bit. Without this definition,
LLVM/Clang 

will generate wrong assemblycode for ARM due to incorrect alignment
information 

and cause executable program bus err. The attached file t.c is the test case
to show 

the bus err. 

 

"clang  -ccc-host-triple armv7-none-linux-gnueabi -mfloat-abi=softfp
-mfpu=neon

-O3 t.c" is the command line. With the optimization, load a short3 will be

promoted to alignment 8 and use ldr.64 to load. ldr.64 is required to have

memory address alignment 4 at least. However, for short3 type, the natural

aligement is alignment 6, with the second element in array, it cannot hold

alignment 4, So the instruction gets bus err.

 

I have reported this into the bugzilla. The URL is 

http://llvm.org/bugs/show_bug.cgi?id=11719

 

At the meantime, I also provide the fix for this problem adding those
missing definitions. 

And I have run the tests from LLVM/Clang in cross mode and simple cross
mode. My fix

doesn't change any result from validtion tests. I believe this is good fix. 

 

Clang.diff is the change for clang portion, LLVM.diff is the change for LLVM
protion.

Test.result and report.txt are failure reports from running llvm/test and
projects/test-suite on ARM.

 

Please review it. Thank you.

 

 

                                                              Yin Ma

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120106/5020f178/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: report.txt
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120106/5020f178/attachment.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.c
Type: application/octet-stream
Size: 334 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120106/5020f178/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.result
Type: application/octet-stream
Size: 1892 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120106/5020f178/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang.diff
Type: application/octet-stream
Size: 806 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120106/5020f178/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm.diff
Type: application/octet-stream
Size: 1020 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120106/5020f178/attachment-0003.obj>


More information about the llvm-commits mailing list