This is an archive of the discontinued LLVM Phabricator instance.

[libomptarget-nvptx] Align data sharing stack
ClosedPublic

Authored by Hahnfeld on Sep 28 2018, 8:23 AM.

Details

Summary

NVPTX requires addresses of pointer locations to be 8-byte aligned
or there will be an exception during runtime.
This could happen without this patch as shown in the added test:
getId() requires 4 byte of stack and putValueInParallel() uses 16
bytes to store the addresses of the captured variables.

Diff Detail

Repository
rL LLVM

Event Timeline

Hahnfeld created this revision.Sep 28 2018, 8:23 AM
grokos accepted this revision.Sep 28 2018, 9:16 AM

Interesting. Are there other cases where alignment is needed?

This revision is now accepted and ready to land.Sep 28 2018, 9:16 AM
jsji removed a subscriber: jsji.Sep 28 2018, 9:24 AM

Interesting. Are there other cases where alignment is needed?

Hmm, what do you mean? This was a corner case I was stumbling across when writing other tests...

This revision was automatically updated to reflect the committed changes.