This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Prevent emission of exception handling code when using OpenMP to offload to NVIDIA devices.
ClosedPublic

Authored by gtbercea on Feb 13 2017, 12:25 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

gtbercea created this revision.Feb 13 2017, 12:25 PM

LGTM. Please run clang-format before committing!

test/OpenMP/target_parallel_no_exceptions.cpp
7–8

Not needed, please keep the test as small as possible

ABataev added inline comments.Mar 29 2017, 11:23 AM
lib/Frontend/CompilerInvocation.cpp
2228–2233

I'm not sure this is the right place for this code.

test/OpenMP/target_parallel_no_exceptions.cpp
5

You can't use #include directive in tests, declare printf function yourself, if you really need it.

gtbercea updated this revision to Diff 93513.Mar 30 2017, 11:47 AM

Clean-up test.

gtbercea marked 2 inline comments as done.Mar 30 2017, 11:48 AM
gtbercea added inline comments.Mar 30 2017, 3:43 PM
lib/Frontend/CompilerInvocation.cpp
2228–2233

Alexey, any suggestion where this code should be moved to?

Hahnfeld requested changes to this revision.Mar 31 2017, 12:07 AM

Out of interest: This is a limition of the implementation, right? Because the standard only says: A throw executed inside a target region must cause execution to resume within the same target region, and the same thread that threw the exception must catch it.

test/OpenMP/target_parallel_no_exceptions.cpp
15

Please make the test be valid OpenMP: inc is not in declare target and it's also a data race.

I think it's enough to only have a target construct in the test.

This revision now requires changes to proceed.Mar 31 2017, 12:07 AM
gtbercea updated this revision to Diff 93665.Mar 31 2017, 9:16 AM
gtbercea edited edge metadata.

Redo regression test.

gtbercea marked 2 inline comments as done.Mar 31 2017, 9:22 AM
gtbercea added inline comments.
lib/Frontend/CompilerInvocation.cpp
2228–2233

Alexey, this code is in the function that initializes Opts.Exceptions and Opts.CXXExceptions and comes after that initialization so the options are not being overwritten by it.

gtbercea updated this revision to Diff 93670.Mar 31 2017, 9:32 AM

run clang-format on test.

Hahnfeld accepted this revision.Apr 20 2017, 1:57 AM

LGTM unless Alexey still has objections

This revision is now accepted and ready to land.Apr 20 2017, 1:57 AM
gtbercea closed this revision.Aug 7 2017, 1:58 PM