This is an archive of the discontinued LLVM Phabricator instance.

[OpenCL] Allow -cl-std and other standard -cl- options in driver
ClosedPublic

Authored by ashi1 on Jun 6 2016, 10:29 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

ashi1 updated this revision to Diff 59746.Jun 6 2016, 10:29 AM
ashi1 retitled this revision from to [OpenCL] Allow -cl-std and other standard -cl- options in driver.
ashi1 updated this object.
ashi1 added a reviewer: Anastasia.
ashi1 added subscribers: yaxunl, cfe-commits, pxli168 and 3 others.
Anastasia added inline comments.Jun 10 2016, 7:43 AM
include/clang/Driver/CC1Options.td
670 ↗(On Diff #59746)

Is this code below to be removed?

671 ↗(On Diff #59746)

This isn't part of this change but could we improve the wording a bit for these items:

The default is optimizations are enabled -> By default optimizations are enabled

673 ↗(On Diff #59746)

This option does nothing and is for compatibility with OpenCL 1.0 -> This option is added for compatibility with OpenCL 1.0.
finish with .

Btw, ideally this option should be deprivcated for CL > 1.0. Could we give diagnostic in this case?

681 ↗(On Diff #59746)

Finish with .

683 ↗(On Diff #59746)

Finish with .

685 ↗(On Diff #59746)

Enable less precise MAD instructions to be generated. -> Allow use of less precise MAD computations in the generated binary.

ashi1 marked 6 inline comments as done.EditedJun 20 2016, 11:37 AM
This comment has been deleted.
include/clang/Driver/CC1Options.td
670 ↗(On Diff #59746)

Yes, I removed the code from CC1Options.td and added replacement in Options.td

673 ↗(On Diff #59746)

I've added a diagnostic. Can you take a look?

ashi1 updated this revision to Diff 61275.Jun 20 2016, 11:39 AM
ashi1 marked 2 inline comments as done.

Revised with Anastasia's comments. Please take a look at the diagnostic to see if it is what we want.

Anastasia added inline comments.Jun 21 2016, 5:19 AM
include/clang/Basic/DiagnosticFrontendKinds.td
220 ↗(On Diff #61275)

Looks good. If we could output the current OpenCL version as well to match the diagnostic style from http://reviews.llvm.org/D19780, it would be nice.

test/Driver/opencl.cl
32 ↗(On Diff #61275)

Could you also test the new diagnostic message you are adding please?

ashi1 updated this revision to Diff 61423.Jun 21 2016, 12:24 PM
ashi1 marked 2 inline comments as done.

Revised based on Anastasia's comments. Also clang-test run passes, the testcases should be working correctly.

Anastasia added inline comments.Jun 22 2016, 8:13 AM
lib/Frontend/CompilerInvocation.cpp
1673 ↗(On Diff #61423)

Could you check the OpenCL version here instead?

1675 ↗(On Diff #61423)

It seems OK to use Opts.OpenCLVersion directly!

test/Driver/opencl.cl
1 ↗(On Diff #61423)

Since you are not checking anything here, do we even need this RUN line?

20 ↗(On Diff #61423)

Could you please separate with an empty line here and order the CHECK lines the same way as RUN lines if possible. It will make it more readable then.

Thanks!

ashi1 updated this revision to Diff 61574.Jun 22 2016, 10:54 AM
ashi1 marked 4 inline comments as done.

Revised to Anastasia's comments.

Anastasia accepted this revision.Jun 23 2016, 3:35 AM
Anastasia edited edge metadata.

LGTM! Thanks!

This revision is now accepted and ready to land.Jun 23 2016, 3:35 AM
This revision was automatically updated to reflect the committed changes.
jvesely added a subscriber: jvesely.Jul 1 2016, 1:59 PM
jvesely added inline comments.
cfe/trunk/include/clang/Driver/Options.td
381

It'd be nice if you added cl-no-signed-zeros since it's mentioned here

We will add it. Thanks.

Sam

ashi1 marked an inline comment as done.Jul 7 2016, 2:54 PM
ashi1 added inline comments.
cfe/trunk/include/clang/Driver/Options.td
381

Can you review http://reviews.llvm.org/D22067 ? Thanks