[PATCH] D58388: [OpenCL] Simplify LLVM IR generated for OpenCL blocks

Alexey Sotkin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 20 07:01:41 PST 2019


AlexeySotkin marked an inline comment as done.
AlexeySotkin added inline comments.


================
Comment at: lib/CodeGen/CGOpenCLRuntime.cpp:131
+static const BlockExpr *getBlockExpr(const Expr *E) {
+  if (auto Cast = dyn_cast<CastExpr>(E)) {
+    E = Cast->getSubExpr();
----------------
Anastasia wrote:
> Btw, does this handle the case when we assign a variable multiple time? I was just wondering if we need a loop somewhere?
> 
> I.e. does something like this work now:
> 
> ```
> typedef void (^bl_t)(local void *);
> 
> bl_t a = ...;
> bl_t b = a;
> bl_t c = b;
> 
> c();
> enqueue_kernel(... c, ...);
> ```
> 
> 
You are right, we need a loop. Now it works.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58388/new/

https://reviews.llvm.org/D58388





More information about the cfe-commits mailing list