Page MenuHomePhabricator

[OpenMPOpt][SplitMemTransfer] Grouping the setup instructions for the runtime call.
Needs ReviewPublic

Authored by hamax97 on Aug 24 2020, 10:26 AM.

Details

Summary

This is just a proposal on how to group the "issue" of the memory transfer __tgt_target_data_begin_mapper.

Based on the information previously stored in OffloadArrays, that is the last stores made to each of the offload array, the structure MemoryTransfer groups these setup instructions into Issue.

Diff Detail

Event Timeline

hamax97 created this revision.Aug 24 2020, 10:26 AM
hamax97 updated this revision to Diff 287732.Aug 25 2020, 11:55 AM
  • NIT changes to comments
jdoerfert added inline comments.Aug 25 2020, 1:42 PM
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
847

We should dump MT or do something to test this.

Also, do we store MT somewhere? Otherwise we might be able to just use a object that cannot be copied.

878

Commit this part as NFC before this patch.

hamax97 added inline comments.Aug 27 2020, 8:52 AM
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
847

Sure, I'll use LLVM_DEBUG to print MT.Issue and I'll create another regression test that checks for that debug information.

Sure, I'll do it. MT is intended to be used for the next step in the algorithm, that is, determining where MT.Issue can be moved. But not for long term storage.

878

Before I can commit this we need to commit https://reviews.llvm.org/D86300.

hamax97 updated this revision to Diff 289049.Aug 31 2020, 5:15 PM
  • Adding regression test
sstefan1 added inline comments.Aug 31 2020, 11:39 PM
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
511

I think it would be useful to make these constants with proper names, eg. constexpr int OffloadPtrsIdx = 0; or something similar. WDYT?

hamax97 added inline comments.Sep 1 2020, 6:52 AM
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
511

I thought abot that but I didn't do it because it might've been too descriptive. Perhaps as attributes of MemoryTransfer would be even better, WDYT?.

hamax97 updated this revision to Diff 291970.Sep 15 2020, 10:46 AM
hamax97 set the repository for this revision to rG LLVM Github Monorepo.
  • Added constants to ease the access to OffloadArrays in the function detectIssue.