[PATCH] D96538: [SYCL] Ignore file-scope asm during device-side SYCL compilation.

Artur Gainullin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 12 17:01:02 PST 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGff50b121e336: [SYCL] Ignore file-scope asm during device-side SYCL compilation. (authored by ArturGainullin).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96538

Files:
  clang/lib/CodeGen/CodeGenModule.cpp
  clang/test/CodeGenSYCL/filescope_asm.c


Index: clang/test/CodeGenSYCL/filescope_asm.c
===================================================================
--- /dev/null
+++ clang/test/CodeGenSYCL/filescope_asm.c
@@ -0,0 +1,6 @@
+// RUN:  %clang_cc1 -fsycl -fsycl-is-device -triple spir64-unknown-unknown-sycldevice -emit-llvm %s -o - | FileCheck %s
+//
+// Check that file-scope asm is ignored during device-side SYCL compilation.
+//
+// CHECK-NOT: module asm "foo"
+__asm__("foo");
Index: clang/lib/CodeGen/CodeGenModule.cpp
===================================================================
--- clang/lib/CodeGen/CodeGenModule.cpp
+++ clang/lib/CodeGen/CodeGenModule.cpp
@@ -5672,6 +5672,9 @@
     // File-scope asm is ignored during device-side OpenMP compilation.
     if (LangOpts.OpenMPIsDevice)
       break;
+    // File-scope asm is ignored during device-side SYCL compilation.
+    if (LangOpts.SYCLIsDevice)
+      break;
     auto *AD = cast<FileScopeAsmDecl>(D);
     getModule().appendModuleInlineAsm(AD->getAsmString()->getString());
     break;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96538.323504.patch
Type: text/x-patch
Size: 1022 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210213/5ea1fecc/attachment.bin>


More information about the cfe-commits mailing list