This is an archive of the discontinued LLVM Phabricator instance.

[Driver][OpenMP] Add logic for offloading-specific argument translation.
ClosedPublic

Authored by sfantao on Jun 29 2016, 11:06 AM.

Details

Summary

This patch includes support for argument translation that is specific of a given offloading kind. Additionally, it implements the translation for OpenMP device kinds in the gcc tool chain.

With this patch, it is possible to compile a functional OpenMP application with offloading capabilities with no separate compilation.

Diff Detail

Event Timeline

sfantao updated this revision to Diff 62245.Jun 29 2016, 11:06 AM
sfantao retitled this revision from to [Driver][OpenMP] Add logic for offloading-specific argument translation..
sfantao updated this object.
ABataev added inline comments.Jun 29 2016, 9:04 PM
include/clang/Driver/Compilation.h
72
  1. 'final'
  2. default initializers for fields.
208

'const' function?

lib/Driver/Compilation.cpp
39–40

for(auto &Arg : TCArgs)

sfantao updated this revision to Diff 62528.Jul 1 2016, 1:12 PM
sfantao marked 3 inline comments as done.
  • Add default initializers to toolchain arguments key and use range based iterator in Dtor.

Hi Alexey,

Thanks for the review!

include/clang/Driver/Compilation.h
72

I added the default initializers but that required me to add a Ctor so that initializer lists work when this struct is built.

208

This one can't be marked const has it potentially changes the cache of translated arguments.

sfantao updated this revision to Diff 62583.Jul 1 2016, 5:15 PM
  • Rebase.
sfantao updated this revision to Diff 66021.Jul 28 2016, 2:50 PM
  • Rebase.
sfantao updated this revision to Diff 72122.Sep 21 2016, 3:47 PM
  • Rebase.
hfinkel added inline comments.Sep 28 2016, 12:25 PM
lib/Driver/ToolChains.cpp
2834

regardless the -> regardless of the

2836

requires to load -> is required to load

2854

And also?

case options::OPT_dynamic:
sfantao updated this revision to Diff 75732.Oct 25 2016, 10:52 AM
sfantao marked 3 inline comments as done.
sfantao edited edge metadata.
  • Fix typos and check -dynamic when it comes to translating arguments for offloading gcc toolchains.

Hi Hal,

Thanks for the review!

lib/Driver/ToolChains.cpp
2854

Oh, yes, that one too! Thanks!

hfinkel accepted this revision.Oct 26 2016, 3:25 PM
hfinkel edited edge metadata.

LGTM

This revision is now accepted and ready to land.Oct 26 2016, 3:25 PM
sfantao closed this revision.Oct 27 2016, 10:49 AM