This is an archive of the discontinued LLVM Phabricator instance.

[OpenMPIRBuilder] Add createOffloadMaptypes and createOffloadMapnames functions
ClosedPublic

Authored by clementval on Apr 28 2021, 6:06 PM.

Details

Summary

Add function to create the offload_maptypes and the offload_mapnames globals. These two functions
are used in clang. They will be used in the Flang/MLIR lowering as well.

Diff Detail

Event Timeline

clementval created this revision.Apr 28 2021, 6:06 PM
clementval requested review of this revision.Apr 28 2021, 6:06 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 28 2021, 6:06 PM

Fix global variable names. Separator comes from OpenMP runtime information.

Macro testcase:

That is, something that calls createOffloadMaptypes/createOffloadMapnames independently of any front-end. Can be as simply as calling it and checking that the returned variable has the expected type and name.

clang/lib/CodeGen/CGOpenMPRuntime.cpp
9379

With SmallVectorImpl for createOffloadMaptypes, this change is not necessary anymore

9401

With SmallVectorImpl for createOffloadMapnames, this change is not necessary anymore

llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
627

Use SmallVectorImpl

631

Use SmallVectorImpl

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

A description at the declaration is sufficient

I assume clang tests apply here. It replaces clang functionality after all.

I assume clang tests apply here. It replaces clang functionality after all.

The policy so far was to have LLVM functionality tested in LLVM itself. See https://reviews.llvm.org/D91470#2395409 and D91643.

clementval marked 5 inline comments as done.

Address review comments

Macro testcase:

That is, something that calls createOffloadMaptypes/createOffloadMapnames independently of any front-end. Can be as simply as calling it and checking that the returned variable has the expected type and name.

Unit tests added :-)

Meinersbur accepted this revision.May 3 2021, 7:27 AM

LGTM, thank you.

This revision is now accepted and ready to land.May 3 2021, 7:27 AM
This revision was landed with ongoing or failed builds.May 3 2021, 12:42 PM
This revision was automatically updated to reflect the committed changes.