diff --git a/lib/SPIRV/OCLToSPIRV.cpp b/lib/SPIRV/OCLToSPIRV.cpp index 6778b0cf32..2c418a1f87 100644 --- a/lib/SPIRV/OCLToSPIRV.cpp +++ b/lib/SPIRV/OCLToSPIRV.cpp @@ -168,11 +168,9 @@ bool OCLToSPIRVBase::runOCLToSPIRV(Module &Module) { auto Src = getSPIRVSource(&Module); // This is a pre-processing pass, which transform LLVM IR module to a more // suitable form for the SPIR-V translation: it is specifically designed to - // handle OpenCL C/C++ and C++ for OpenCL modules and shouldn't be launched - // for other source languages. - if (std::get<0>(Src) != spv::SourceLanguageOpenCL_C && - std::get<0>(Src) != spv::SourceLanguageOpenCL_CPP && - std::get<0>(Src) != spv::SourceLanguageCPP_for_OpenCL) + // handle OpenCL C built-in functions and shouldn't be launched for other + // source languages + if (std::get<0>(Src) != spv::SourceLanguageOpenCL_C) return false; CLVer = std::get<1>(Src); diff --git a/lib/SPIRV/OCLTypeToSPIRV.cpp b/lib/SPIRV/OCLTypeToSPIRV.cpp index 0c9f6f9a96..6d7c59963b 100644 --- a/lib/SPIRV/OCLTypeToSPIRV.cpp +++ b/lib/SPIRV/OCLTypeToSPIRV.cpp @@ -87,13 +87,7 @@ bool OCLTypeToSPIRVBase::runOCLTypeToSPIRV(Module &Module) { AdaptedTy.clear(); WorkSet.clear(); auto Src = getSPIRVSource(&Module); - // This is a pre-processing pass, which transform LLVM IR module to a more - // suitable form for the SPIR-V translation: it is specifically designed to - // handle OpenCL C/C++ and C++ for OpenCL types and shouldn't be launched for - // other source languages. - if (std::get<0>(Src) != spv::SourceLanguageOpenCL_C && - std::get<0>(Src) != spv::SourceLanguageOpenCL_CPP && - std::get<0>(Src) != spv::SourceLanguageCPP_for_OpenCL) + if (std::get<0>(Src) != spv::SourceLanguageOpenCL_C) return false; for (auto &F : Module.functions()) diff --git a/test/extensions/INTEL/SPV_INTEL_arbitrary_precision_fixed_point/capability-arbitrary-precision-fixed-point-numbers.ll b/test/extensions/INTEL/SPV_INTEL_arbitrary_precision_fixed_point/capability-arbitrary-precision-fixed-point-numbers.ll index 81f915d2e3..8e4c2512a3 100644 --- a/test/extensions/INTEL/SPV_INTEL_arbitrary_precision_fixed_point/capability-arbitrary-precision-fixed-point-numbers.ll +++ b/test/extensions/INTEL/SPV_INTEL_arbitrary_precision_fixed_point/capability-arbitrary-precision-fixed-point-numbers.ll @@ -541,7 +541,7 @@ attributes #5 = { nounwind } !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 1, i32 2} -!2 = !{i32 7, i32 100000} +!2 = !{i32 4, i32 100000} !3 = !{!"clang version 11.0.0"} !4 = !{} !5 = !{!6, !6, i64 0} diff --git a/test/ocl_to_spirv_for_cpp_for_opencl.ll b/test/ocl_to_spirv_for_cpp_for_opencl.ll deleted file mode 100644 index 52d2f89991..0000000000 --- a/test/ocl_to_spirv_for_cpp_for_opencl.ll +++ /dev/null @@ -1,27 +0,0 @@ -;; This test checks if builtins in LLVM IR generated from CPP_for_OpenCL sources -;; are correctly translated to SPIR-V builtin variables. - -; RUN: llvm-as %s -o %t.bc -; RUN: llvm-spirv %t.bc -o %t.spv -; RUN: llvm-spirv %t.bc -spirv-text -o %t.txt -; RUN: FileCheck < %t.txt %s --check-prefix=CHECK-SPIRV -; RUN: spirv-val %t.spv - -target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" -target triple = "spir-unknown-unknown" - -%opencl.event_t = type opaque - -; CHECK-SPIRV: {{[0-9]+}} Name {{[0-9]+}} "__spirv_BuiltInWorkgroupId" -; Function Attrs: nounwind -define spir_kernel void @test_fn(i32 %a) { -entry: - %call15 = call spir_func i32 @_Z12get_group_idj(i32 0) - ret void -} - -declare spir_func i32 @_Z12get_group_idj(i32) - -!spirv.Source = !{!0} - -!0 = !{i32 6, i32 100000} diff --git a/test/ocl_to_spirv_for_opencl_cpp.ll b/test/ocl_to_spirv_for_opencl_cpp.ll deleted file mode 100644 index 0cae931f15..0000000000 --- a/test/ocl_to_spirv_for_opencl_cpp.ll +++ /dev/null @@ -1,27 +0,0 @@ -;; This test checks if builtins in LLVM IR generated from OpenCL_CPP sources -;; are correctly translated to SPIR-V builtin variables. - -; RUN: llvm-as %s -o %t.bc -; RUN: llvm-spirv %t.bc -o %t.spv -; RUN: llvm-spirv %t.bc -spirv-text -o %t.txt -; RUN: FileCheck < %t.txt %s --check-prefix=CHECK-SPIRV -; RUN: spirv-val %t.spv - -target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" -target triple = "spir-unknown-unknown" - -%opencl.event_t = type opaque - -; CHECK-SPIRV: {{[0-9]+}} Name {{[0-9]+}} "__spirv_BuiltInWorkgroupId" -; Function Attrs: nounwind -define spir_kernel void @test_fn(i32 %a) { -entry: - %call15 = call spir_func i32 @_Z12get_group_idj(i32 0) - ret void -} - -declare spir_func i32 @_Z12get_group_idj(i32) - -!spirv.Source = !{!0} - -!0 = !{i32 4, i32 100000}