[PATCH] D31417: [OpenMP] Add support for omp simd pragmas without runtime

Graham Hunter via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 3 05:04:12 PDT 2017


huntergr added inline comments.


================
Comment at: lib/Parse/ParseOpenMP.cpp:174
+      case OMPD_target_teams_distribute_simd:
+        DKind = OMPD_simd;
+        break;
----------------
rengolin wrote:
> I'd like @ABataev to confirm this is the right semantics.
Yes, would be good. I don't think there's a formal spec for this feature, but it's possible that directives intended for a different target than the cpu shouldn't apply with this flag.


================
Comment at: lib/Parse/ParseOpenMP.cpp:1047
+    // as the filter function will have switched the kind.
+    if (!getLangOpts().OpenMPSimd)
+      Diag(Tok, diag::err_omp_unknown_directive);
----------------
rengolin wrote:
> What if it's really unknown, even to `-fopenmp-simd`?
I did wonder about handling this case; I defaulted to ignoring it, since we are already filtering out other non-simd constructs.

If we do want to catch it, then I can think of two options: creating the diagnostic right before the filter switch (possibly messy), or adding a new enum value of OMPD_non_simd_construct (or a similar name) to represent constructs we recognize but don't want to handle and differentiate against a true unknown. I think the latter would be preferable.


https://reviews.llvm.org/D31417





More information about the cfe-commits mailing list