This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][OMPIRBuilder] Rename IsEmbedded and IsTargetCodegen flags
ClosedPublic

Authored by skatrak on Jul 6 2023, 3:30 AM.

Details

Summary

This patch renames the OpenMPIRBuilderConfig flags to reduce confusion over
their meaning. IsTargetCodegen becomes IsGPU, whereas IsEmbedded becomes
IsTargetDevice. The -fopenmp-is-device compiler option is also renamed to
-fopenmp-is-target-device and the omp.is_device MLIR attribute is renamed
to omp.is_target_device. Getters and setters of all these renamed properties
are also updated accordingly. Many unit tests have been updated to use the new
names, but an alias for the -fopenmp-is-device option is created so that
external programs do not stop working after the name change.

IsGPU is set when the target triple is AMDGCN or NVIDIA PTX, and it is also
valid if IsTargetDevice is specified as well. IsTargetDevice is set by the
-fopenmp-is-target-device compiler frontend option, which is only added to
the OpenMP device invocation for offloading-enabled programs.

Diff Detail

Event Timeline

skatrak created this revision.Jul 6 2023, 3:30 AM
Herald added a reviewer: ftynse. · View Herald Transcript
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
skatrak requested review of this revision.Jul 6 2023, 3:30 AM
Herald added projects: Restricted Project, Restricted Project, Restricted Project. · View Herald Transcript
skatrak updated this revision to Diff 537768.Jul 6 2023, 9:28 AM

Rebase to try resolving build failure.

Works for me. Tag @jhuber6

jhuber6 accepted this revision.Jul 6 2023, 10:45 AM

Noisy change but shouldn't really affect much. Names area little overloaded here so it's good to be more specific. Thanks.

This revision is now accepted and ready to land.Jul 6 2023, 10:45 AM
skatrak updated this revision to Diff 538135.Jul 7 2023, 7:18 AM

Rebase and fix issues.

This patch has been triggering a seemingly unrelated build error in libcxx, even after multiple rebases. Can I land it as-is or is this error something I should address first? Thank you.

Yeah that happens sometimes, if it's working on your system it's safe to assume it's fine. Worst case scenario you can always revert, it's not a big deal.

This revision was landed with ongoing or failed builds.Jul 10 2023, 6:15 AM
This revision was automatically updated to reflect the committed changes.