[PATCH] D29339: [OpenMP] Add support for auxiliary triple specification
Jonas Hahnfeld via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 31 01:37:36 PDT 2017
Hahnfeld accepted this revision.
Hahnfeld added a comment.
This revision is now accepted and ready to land.
LGTM
================
Comment at: lib/Driver/ToolChains/Clang.cpp:1967-1968
+ C.getSingleOffloadToolChain<Action::OFK_Host>()
+ ->getTriple()
+ .normalize();
+ CmdArgs.push_back("-aux-triple");
----------------
I might be wrong here... Can you run the code through `clang-format` before committing to be sure?
================
Comment at: lib/Frontend/CompilerInstance.cpp:914-915
+ // Create TargetInfo for the other side of CUDA and OpenMP compilation.
+ if ((getLangOpts().CUDA && !getFrontendOpts().AuxTriple.empty()) ||
+ (getLangOpts().OpenMPIsDevice && !getFrontendOpts().AuxTriple.empty())) {
auto TO = std::make_shared<TargetOptions>();
----------------
ABataev wrote:
> It's better to check `!getFrontendOpts().AuxTriple.empty()` only once in this condition
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.
Repository:
rL LLVM
https://reviews.llvm.org/D29339
More information about the cfe-commits
mailing list