This is an archive of the discontinued LLVM Phabricator instance.

[SystemZ] Fix vecintrin.h to not emit alignment hints in vec_xl/vec_xst.
ClosedPublic

Authored by jonpa on Feb 10 2021, 4:53 PM.

Details

Summary

vec_xl() and vec_xst() should not emit alignment hints since they take a scalar pointer and also add an arbitrary byte offset to that.

This uses memcpy to achieve the desired result which seems to work well with optimizations enabled.

(I did not manage to use some kind of "attribute aligned" on the pointer to make the alignment go away...)

Diff Detail

Event Timeline

jonpa requested review of this revision.Feb 10 2021, 4:53 PM
jonpa created this revision.

It's not a good idea to use the library routine "memcpy" here, because the name in theory be redefined by a user before including the header, and also there may not be a prototype in scope causing warnings when building with -Wall.

But both problems can be fixed by simply using the intrinsic "__builtin_memcpy" instead.

Patch LGTM with that change.

This revision was not accepted when it landed; it landed in state Needs Review.Feb 12 2021, 4:30 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 12 2021, 4:30 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
jonpa added a comment.Feb 12 2021, 4:32 PM

Committed after changed to use __builtin_memcpy() instead.