This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Add support for auxiliary triple specification
ClosedPublic

Authored by gtbercea on Jan 31 2017, 10:49 AM.

Details

Summary

Device offloading requires the specification of an additional flag containing the triple of the other architecture the code is being compiled on if such an architecture exists. If compiling for the host, the auxiliary triple flag will contain the triple describing the device and vice versa.

Diff Detail

Repository
rL LLVM

Event Timeline

gtbercea created this revision.Jan 31 2017, 10:49 AM
gtbercea added a reviewer: arpith-jacob.
ABataev added inline comments.Feb 1 2017, 1:08 AM
lib/Frontend/CompilerInstance.cpp
914–915

It's better to check !getFrontendOpts().AuxTriple.empty() only once in this condition

gtbercea updated this revision to Diff 86635.Feb 1 2017, 7:31 AM

Condition changed to only check triple once.

gtbercea marked an inline comment as done.Feb 1 2017, 7:31 AM
gtbercea updated this revision to Diff 93171.Mar 27 2017, 1:10 PM

Update patch to reflect latest source code changes.

Hahnfeld accepted this revision.Mar 31 2017, 1:37 AM

LGTM

lib/Driver/ToolChains/Clang.cpp
1967–1968 ↗(On Diff #93171)

I might be wrong here... Can you run the code through clang-format before committing to be sure?

lib/Frontend/CompilerInstance.cpp
914–915

Another micro optimization: (getLangOpts().CUDA || getLangOpts().OpenMPIsDevice) is probably cheaper than !getFrontendOpts().AuxTriple.empty() so it might be worth swapping the conditions as in the original code.

This revision is now accepted and ready to land.Mar 31 2017, 1:37 AM
gtbercea updated this revision to Diff 93643.Mar 31 2017, 7:57 AM

Re-order conditions and run clang-format.

gtbercea marked 2 inline comments as done.Mar 31 2017, 7:58 AM
gtbercea closed this revision.Jun 29 2017, 8:49 AM