This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][OMPIRBuilder] Migrate emitOffloadingArrays and EmitNonContiguousDescriptor from Clang
ClosedPublic

Authored by TIFitis on May 4 2023, 10:01 AM.

Details

Summary

This patch migrates the emitOffloadingArrays and EmitNonContiguousDescriptor functions from Clang codegen to OpenMPIRBuilder.

Diff Detail

Event Timeline

TIFitis created this revision.May 4 2023, 10:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2023, 10:01 AM
TIFitis requested review of this revision.May 4 2023, 10:01 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 4 2023, 10:01 AM
TIFitis updated this revision to Diff 519822.May 5 2023, 5:45 AM

Changed std::function to llvm::function_ref for the callbacks.

jsjodin added inline comments.May 8 2023, 12:58 PM
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
4427

I don't think we need a lambda function, it can be a regular method or static function?

4627

Do we need to check if DeviceAddrCB is null?

4652

Check if CustomMapperCB is nullptr?

TIFitis updated this revision to Diff 520730.May 9 2023, 9:37 AM

Addressed reviewer comments.

TIFitis marked 3 inline comments as done.May 15 2023, 5:52 AM

Ping for review :)

Ping for review :)

jdoerfert accepted this revision.Jun 9 2023, 10:25 AM

If this passes all our tests, it looks fine. A few nits below, try to address if possible.

llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
4440

If it helps, you can define the struct type in OMPKind.td, I think that's the name.

4500

Can we do an early exit here?

4575

Generally try to have the "short" branch first, especially one liners.
People have forgotten the condition when they get here.

4631

Add a message to all asserts, please.

This revision is now accepted and ready to land.Jun 9 2023, 10:25 AM
TIFitis updated this revision to Diff 530508.Jun 12 2023, 7:42 AM
TIFitis marked 4 inline comments as done.

Addressed reviewer comments.

This revision was landed with ongoing or failed builds.Jun 12 2023, 7:43 AM
This revision was automatically updated to reflect the committed changes.