[PATCH] D38134: [OpenCL] Emit enqueued block as kernel

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 12 08:00:26 PDT 2017


Anastasia added a comment.

I think it would be good to add a block test to CodeGenOpenCL where we would just call the block without any enqueue and check that the invoke function is generated but the kernel wrapper isn't.



================
Comment at: lib/CodeGen/CGBuiltin.cpp:2846
+          PtrToSizeArray};
+      std::vector<llvm::Type *> ArgTys = {QueueTy,
+                                          IntTy,
----------------
Formatting seems inconsistent from above.


================
Comment at: lib/CodeGen/CodeGenFunction.h:2921
 private:
-  /// Helpers for blocks
-  llvm::Value *EmitBlockLiteral(const CGBlockInfo &Info);
+  /// Helpers for blocks. Returns invoke function by \p InvokeF if it is not
+  /// nullptr.
----------------
It will be nullptr in case block is not enqueued? May be it's worth explaining it in the comment.


================
Comment at: lib/CodeGen/TargetInfo.h:290
   }
+  /// Create an OpenCL kernel for an enqueued block.
+  virtual llvm::Function *
----------------
Can we also explain the wrapper kernel here?


https://reviews.llvm.org/D38134





More information about the cfe-commits mailing list