[PATCH] D21031: [OpenCL] Allow -cl-std and other standard -cl- options in driver

Anastasia Stulova via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 10 07:43:51 PDT 2016


Anastasia added inline comments.

================
Comment at: include/clang/Driver/CC1Options.td:670
@@ -669,21 +669,3 @@
 
-def cl_opt_disable : Flag<["-"], "cl-opt-disable">,
-  HelpText<"OpenCL only. This option disables all optimizations. The default is optimizations are enabled.">;
-def cl_strict_aliasing : Flag<["-"], "cl-strict-aliasing">,
-  HelpText<"OpenCL only. This option does nothing and is for compatibility with OpenCL 1.0">;
-def cl_single_precision_constant : Flag<["-"], "cl-single-precision-constant">,
-  HelpText<"OpenCL only. Treat double precision floating-point constant as single precision constant.">;
-def cl_finite_math_only : Flag<["-"], "cl-finite-math-only">,
-  HelpText<"OpenCL only. Allow floating-point optimizations that assume arguments and results are not NaNs or +-Inf.">;
-def cl_kernel_arg_info : Flag<["-"], "cl-kernel-arg-info">,
-  HelpText<"OpenCL only. Generate kernel argument metadata.">;
-def cl_unsafe_math_optimizations : Flag<["-"], "cl-unsafe-math-optimizations">,
-  HelpText<"OpenCL only. Allow unsafe floating-point optimizations.  Also implies -cl-no-signed-zeros and -cl-mad-enable">;
-def cl_fast_relaxed_math : Flag<["-"], "cl-fast-relaxed-math">,
-  HelpText<"OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines __FAST_RELAXED_MATH__">;
-def cl_mad_enable : Flag<["-"], "cl-mad-enable">,
-  HelpText<"OpenCL only. Enable less precise MAD instructions to be generated.">;
-def cl_std_EQ : Joined<["-"], "cl-std=">,
-  HelpText<"OpenCL language standard to compile for">;
-def cl_denorms_are_zero : Flag<["-"], "cl-denorms-are-zero">,
-  HelpText<"OpenCL only. Allow denormals to be flushed to zero">;
+//def cl_opt_disable : Flag<["-"], "cl-opt-disable">,
+//  HelpText<"OpenCL only. This option disables all optimizations. The default is optimizations are enabled.">;
----------------
Is this code below to be removed?

================
Comment at: include/clang/Driver/CC1Options.td:671
@@ +670,3 @@
+//def cl_opt_disable : Flag<["-"], "cl-opt-disable">,
+//  HelpText<"OpenCL only. This option disables all optimizations. The default is optimizations are enabled.">;
+//def cl_strict_aliasing : Flag<["-"], "cl-strict-aliasing">,
----------------
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

================
Comment at: include/clang/Driver/CC1Options.td:673
@@ +672,3 @@
+//def cl_strict_aliasing : Flag<["-"], "cl-strict-aliasing">,
+//  HelpText<"OpenCL only. This option does nothing and is for compatibility with OpenCL 1.0">;
+//def cl_single_precision_constant : Flag<["-"], "cl-single-precision-constant">,
----------------
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?

================
Comment at: include/clang/Driver/CC1Options.td:681
@@ +680,3 @@
+//def cl_unsafe_math_optimizations : Flag<["-"], "cl-unsafe-math-optimizations">,
+//  HelpText<"OpenCL only. Allow unsafe floating-point optimizations.  Also implies -cl-no-signed-zeros and -cl-mad-enable">;
+//def cl_fast_relaxed_math : Flag<["-"], "cl-fast-relaxed-math">,
----------------
Finish with .

================
Comment at: include/clang/Driver/CC1Options.td:683
@@ +682,3 @@
+//def cl_fast_relaxed_math : Flag<["-"], "cl-fast-relaxed-math">,
+//  HelpText<"OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines __FAST_RELAXED_MATH__">;
+//def cl_mad_enable : Flag<["-"], "cl-mad-enable">,
----------------
Finish with .

================
Comment at: include/clang/Driver/CC1Options.td:685
@@ +684,3 @@
+//def cl_mad_enable : Flag<["-"], "cl-mad-enable">,
+//  HelpText<"OpenCL only. Enable less precise MAD instructions to be generated.">;
+//def cl_std_EQ : Joined<["-"], "cl-std=">,
----------------
Enable less precise MAD instructions to be generated. -> Allow use of less precise MAD computations in the generated binary.


http://reviews.llvm.org/D21031





More information about the cfe-commits mailing list