[PATCH] D60455: [SYCL] Implement SYCL device code outlining

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 27 07:40:54 PST 2019


ABataev added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:2477
 
+  if (LangOpts.SYCLIsDevice && Global->hasAttr<SYCLKernelAttr>()) {
+    // SYCL kernels can be templated and not called from anywhere in the
----------------
bader wrote:
> ABataev wrote:
> > Need to check if the decl must be emitted at all.
> Let me check that I get it right. You suggest adding `if (MustBeEmitted(Global))`, right?
> ```
>   if (LangOpts.SYCLIsDevice && Global->hasAttr<SYCLKernelAttr>() && MustBeEmitted(Global)) {
>     ...
>     addDeferredDeclToEmit(GD);
>     return;
>   }
> ```
Yes


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60455





More information about the cfe-commits mailing list