This is an archive of the discontinued LLVM Phabricator instance.

[Clang][OpenMP] Fix run time crash when use_device_addr is used.
ClosedPublic

Authored by jyu2 on Sep 23 2022, 11:15 AM.

Details

Summary

It is due to data mapping ordering.

According omp spec:
If one or more map clauses are present, the list item conversions that are performed for any use_device_ptr or use_device_addr clause occur after all variables are mapped on entry to the region according to those map clauses.

The change is to put mapping data for use_device_addr at end of data mapping array.

Diff Detail

Event Timeline

jyu2 created this revision.Sep 23 2022, 11:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 23 2022, 11:15 AM
jyu2 requested review of this revision.Sep 23 2022, 11:15 AM
ABataev added inline comments.Sep 23 2022, 12:42 PM
clang/lib/CodeGen/CGOpenMPRuntime.cpp
8573–8650

Can you try to merge these 2 blocks somehow, they are very similar

jyu2 added inline comments.Sep 26 2022, 2:27 PM
clang/lib/CodeGen/CGOpenMPRuntime.cpp
8573–8650

Should I do this with NFC in next patch. Or should I change now.
Thanks,

Jennifer

jyu2 updated this revision to Diff 463257.Sep 27 2022, 9:22 AM

Merge duplicate code as Alexey suggested.

This revision is now accepted and ready to land.Sep 27 2022, 10:01 AM
This revision was automatically updated to reflect the committed changes.
jyu2 marked an inline comment as done.