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

Manjunath Kudlur keveman at gmail.com
Mon Apr 14 17:41:07 PDT 2014



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

================
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
----------------
Reid Kleckner wrote:
> nit: indentation
Fixed.

================
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) {
----------------
Reid Kleckner wrote:
> The naming for local variables is StudlyCaps.
Fixed.


http://reviews.llvm.org/D3318






More information about the cfe-commits mailing list