[PATCH] Added support for CUDA __launch_bounds__ attribute to CodeGen.

Reid Kleckner rnk at google.com
Mon Apr 14 17:15:19 PDT 2014


  lgtm


================
Comment at: lib/CodeGen/TargetInfo.cpp:4770
@@ -4768,1 +4769,3 @@
+  static void addNVVMMetadata(llvm::Function *F, StringRef Name,
+                              const int Operand);
 };
----------------
Having const ints feels silly, since the caller really doesn't care.

================
Comment at: lib/CodeGen/TargetInfo.cpp:4848
@@ +4847,3 @@
+      addNVVMMetadata(F, "maxntidx",
+                       FD->getAttr<CUDALaunchBoundsAttr>()->getMaxThreads());
+      // min blocks is a default argument for CUDALaunchBoundsAttr, so getting a
----------------
nit: indentation

================
Comment at: lib/CodeGen/TargetInfo.cpp:4853
@@ +4852,3 @@
+      // don't have to add a PTX directive.
+      int minctasm = FD->getAttr<CUDALaunchBoundsAttr>()->getMinBlocks();
+      if (minctasm > 0) {
----------------
The naming for local variables is StudlyCaps.


http://reviews.llvm.org/D3318






More information about the cfe-commits mailing list