This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Make generating offloading entries more generic
ClosedPublic

Authored by jhuber6 on Apr 9 2022, 8:14 PM.

Details

Summary

This patch moves the logic for generating the offloading entries to the
OpenMPIRBuilder. This makes it easier to re-use in other places, such as
for OpenMP support in Flang or using the same method for generating
offloading entires for other languages like Cuda.

Diff Detail

Event Timeline

jhuber6 created this revision.Apr 9 2022, 8:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 9 2022, 8:14 PM
jhuber6 requested review of this revision.Apr 9 2022, 8:14 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 9 2022, 8:14 PM
jhuber6 updated this revision to Diff 421764.Apr 9 2022, 8:18 PM

clang format.

jhuber6 updated this revision to Diff 421794.Apr 10 2022, 9:24 AM

Change constant to just be a string since it's all we use.

tianshilei1992 accepted this revision.Apr 11 2022, 2:41 PM

If we'd like it to be used by CUDA or other programming models, llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp is not a good place. Other than that, the patch looks good to me.

This revision is now accepted and ready to land.Apr 11 2022, 2:41 PM

If we'd like it to be used by CUDA or other programming models, llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp is not a good place. Other than that, the patch looks good to me.

I couldn't think of a better place to put this. Using it outside of OpenMP just requires initializing the OpenMP types so it's not a huge burden. I also want to change the names from omp_offloading so it's more generic but figured I wouldn't pollute the patch with those test changes.

This revision was landed with ongoing or failed builds.Apr 29 2022, 6:14 AM
This revision was automatically updated to reflect the committed changes.