[cfe-commits] [PATCH] PR12094: set alignment of memory builtins
Jay Foad
jay.foad at gmail.com
Fri Mar 2 03:57:47 PST 2012
http://llvm.org/bugs/show_bug.cgi?id=12094
The attached patch:
- Makes CGBuiltin.cpp's helper function GetPointeeAlignment into a
proper member of CodeGenFunction and splits it into two:
-- GetPointeeAlignment, which returns alignment as an unsigned, and
-- GetPointeeAlignmentValue, which wraps the result in an llvm::Value
for the convenience of generating ARM NEON intrinsics.
- Uses GetPointeeAlignment to set a sensible alignment on all memory
intrinsics (memcpy, memset etc.) instead of the conservative default
of 1.
Tested with "make check-all". Unfortunately I can only test on x86_64,
where alignment doesn't make much difference. Can anyone test it on
what GCC would call a STRICT_ALIGNMENT target for me?
I also tried compiling sqlite3.c (from test-suite) with clang -O2,
before and after my changes. The only differences were a handful of
calls to memcpy replaced with "rep;movsq", which seems good.
Thanks,
Jay.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: getpointeealignment.diff
Type: text/x-patch
Size: 13605 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120302/bc45bb35/attachment.bin>
More information about the cfe-commits
mailing list