[PATCH] D25343: [OpenCL] Mark group functions as convergent in opencl-c.h

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 12 11:26:08 PDT 2016


aaron.ballman added inline comments.


================
Comment at: include/clang/Basic/AttrDocs.td:612
+  let Content = [{
+The ``convergent`` attribute can be placed on function declarations. It is
+translated to LLVM ``convergent`` attribute, which indicates the call
----------------
on a function declaration


================
Comment at: include/clang/Basic/AttrDocs.td:613
+The ``convergent`` attribute can be placed on function declarations. It is
+translated to LLVM ``convergent`` attribute, which indicates the call
+instructions of a function with this attribute cannot be made control-dependent
----------------
s/to/into the
s/the call/that the call


================
Comment at: include/clang/Basic/AttrDocs.td:621
+
+This attribute is different from ``noduplicate`` since it allows duplicating
+function calls if it can be proved that the duplicated function calls are
----------------
s/since/because


================
Comment at: include/clang/Basic/AttrDocs.td:629
+
+  void convfunc() __attribute__((convergent));
+  // Setting it as a C++11 attribute is also valid
----------------
Since this is a C block, perhaps that should be `void convfunc(void)` instead?


================
Comment at: test/CodeGenOpenCL/convergent.cl:118
+// CHECK-DAG: attributes #[[attr5]] = { {{[^}]*}}convergent{{[^}]*}} }
+// CHECK-DAG: attributes #[[attr6]] = { {{[^}]*}}noduplicate{{[^}]*}} }
----------------
Missing the Sema tests for the attribute's semantics (applies only to functions, accepts no args, etc).


https://reviews.llvm.org/D25343





More information about the cfe-commits mailing list