[PATCH v2] Respect alignment when loading up a coerced function argument

Ulrich Weigand Ulrich.Weigand at de.ibm.com
Fri Jun 19 09:16:43 PDT 2015


Hal Finkel <hfinkel at anl.gov> wrote on 06.05.2015 00:09:45:

> >> This patch adds a setAlignment call in one place in CreateCoercedLoad
> >> where it was missing so far.  Note that as this location, we do not
> >> actually know what alignment of the source location we can rely on;
> >> the callers do not pass anything to this routine.
>
> Can we actually fix this problem so that the correct alignment can be
used?

Here's a new version of the patch that changes CreateCoercedLoad to take
an alignment operand and changes the callers to pass in the best data they
have.  For consistency, I've done the same to CreateCoercedStore as well
(although isn't required for correctness reasons on SystemZ).

This does indeed reduce the number of misaligned loads and store quite
at bit, as can be seen in the test cases I've had to update ...

(See attached file: clang-align-coerced)

Does this look OK?

Bye,
Ulrich
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-align-coerced
Type: application/octet-stream
Size: 36997 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150619/493e2fcb/attachment.obj>


More information about the cfe-commits mailing list