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;
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;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits