...
 
Commits (20)
project( common_clang )
cmake_minimum_required(VERSION 2.8.8)
cmake_minimum_required(VERSION 3.4.3)
# Do not omit TARGET_OBJECTS expression from the SOURCES target
# property
......@@ -81,10 +81,10 @@ set(TARGET_NAME ${COMMON_CLANG_LIBRARY_NAME}${BUILD_PLATFORM} )
if(NOT USE_PREBUILT_LLVM)
set(TARGET_BRANCH "ocl-open-80")
set(CLANG_SOURCE_DIR ${LLVM_SOURCE_DIR}/tools/clang)
set(CLANG_BASE_REVISION e7524422bf4ee02f80a528547cde7e45b30c83dc)
set(CLANG_BASE_REVISION a03da8be08a208122e292016cb6cea1f30229677)
set(SPIRV_SOURCE_DIR ${LLVM_SOURCE_DIR}/projects/llvm-spirv)
set(SPIRV_BASE_REVISION 0650ff887b5ef00066e6a0527bab592dafd59c83)
set(SPIRV_BASE_REVISION 049776f815b12525dcd7a0869e0ee68a70d01b92)
apply_patches(${CLANG_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/patches/clang
......@@ -175,54 +175,13 @@ link_directories(
${LLVM_LIBRARY_DIRS}
)
if (LLVM_LINK_LLVM_DYLIB)
set (LLVM_LIBS LLVM)
else (LLVM_LINK_LLVM_DYLIB)
set (LLVM_LIBS
Analysis
AsmParser
AsmPrinter
BitReader
BitWriter
CodeGen
Core
IRReader
InstCombine
Instrumentation
MC
MCDisassembler
MCParser
ObjCARCOpts
Object
Option
ProfileData
ScalarOpts
SelectionDAG
Support
Target
TransformUtils
Vectorize
X86AsmParser
X86AsmPrinter
X86CodeGen
X86Desc
X86Disassembler
X86Info
X86Utils)
endif (LLVM_LINK_LLVM_DYLIB)
set(ADDITIONAL_LIBS )
set(ADDITIONAL_LIBS ${CMAKE_DL_LIBS})
if(USE_PREBUILT_LLVM AND NOT LLVMSPIRV_INCLUDED_IN_LLVM)
if(NOT LLVMSPIRVLib IN_LIST LLVM_AVAILABLE_LIBS)
# SPIRV-LLVM-Translator is not included into LLVM as a component.
# So, we need to list it there explicitly as a library
set(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} LLVMSPIRVLib)
elseif(NOT LLVM_LINK_LLVM_DYLIB)
# SPIRV-LLVM-Translator is included into LLVM as a component, but
# LLVM components is not linked together into an umbrella library.
# So, we need to list SPIRV-LLVM-Translator there explicitly as a component
set(LLVM_LIBS ${LLVM_LIBS} SPIRVLib)
endif(USE_PREBUILT_LLVM AND NOT LLVMSPIRV_INCLUDED_IN_LLVM)
# So, we need to list it here explicitly as an external library
list(APPEND ADDITIONAL_LIBS LLVMSPIRVLib)
endif()
add_subdirectory(cl_headers)
......@@ -235,7 +194,7 @@ add_llvm_library(${TARGET_NAME} SHARED
DEPENDS CClangCompileOptions
LINK_COMPONENTS
${LLVM_LIBS}
all
LINK_LIBS
# The list of clang libraries is taken from clang makefile
# (build/tools/clang/tools/driver/CMakeFiles/clang.dir/link.txt)
......@@ -269,7 +228,7 @@ add_llvm_library(${TARGET_NAME} SHARED
clangLex
clangBasic
${ADDITIONAL_LIBS}
${CMAKE_DL_LIBS})
)
# Configure resource file on Windows
if (WIN32)
......@@ -303,6 +262,9 @@ if (WIN32)
"RC_PRODUCT_NAME=\"${RC_PRODUCT_NAME}\""
"RC_PRODUCT_VERSION=\"${RC_FILE_VERSION}\""
"RC_COPYRIGHT=\"Copyright ${RC_CHAR_C} 2018 Intel Corporation. All rights reserved.\"")
elseif(UNIX)
set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY
LINK_FLAGS " -Wl,--no-undefined")
endif(WIN32)
install(FILES common_clang.h
......
intel-opencl-clang (0+git20190307-1) UNRELEASED; urgency=medium
intel-opencl-clang (8.0.0-1) experimental; urgency=medium
* New upstream release.
* control: Bump build-dep on llvm/clang.
* watch: Added.
* Follow upstream and rename binaries.
* dlopen-soname.diff: Make sure the soname is opened instead of linker
name.
-- Timo Aaltonen <tjaalton@debian.org> Mon, 08 Apr 2019 16:14:20 +0300
intel-opencl-clang (0+git20190318-1) experimental; urgency=medium
* New upstream snapshot.
* Build against libllvmspirvlib8.
* Sync with ocl-open-80 -branch.
* control: Add homepage.
* control: Limit to amd64, i386.
* control: Build with clang-8.
* Rename binaries back to libcommon-clang*.
* control: Add libedit-dev and zlib1g-dev to build-depends.
* rules: Fix build against libllvmspirvlib.
* control: Bump build-dep on libllvmspirvlib-dev.
-- Timo Aaltonen <tjaalton@debian.org> Thu, 14 Feb 2019 16:31:46 +0200
-- Timo Aaltonen <tjaalton@debian.org> Wed, 20 Mar 2019 18:31:35 +0200
intel-opencl-clang (0+git20190204-1) experimental; urgency=medium
......
......@@ -4,20 +4,18 @@ Priority: optional
Maintainer: Debian OpenCL team <pkg-opencl-devel@lists.alioth.debian.org>
Uploaders: Timo Aaltonen <tjaalton@debian.org>
Build-Depends: debhelper (>= 11),
clang-8,
clang-8 (>= 1:8-2~),
cmake,
git,
libclang-8-dev,
libedit-dev,
libllvmspirvlib-dev,
llvm-8-dev,
zlib1g-dev,
libclang-8-dev (>= 1:8-2~),
libllvmspirvlib-dev (>= 8.0.0+git20190314-1~),
llvm-8-dev (>= 1:8-2~),
Standards-Version: 4.3.0
Homepage: https://github.com/intel/opencl-clang
Vcs-Browser: https://salsa.debian.org/opencl-team/intel-opencl-clang
Vcs-Git: https://salsa.debian.org/opencl-team/intel-opencl-clang.git
Package: libcommon-clang8
Package: libopencl-clang8
Architecture: amd64 i386
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: thin wrapper for clang
......@@ -25,11 +23,11 @@ Description: thin wrapper for clang
OpenCL-oriented API and is capable of compiling OpenCL C kernels
to SPIR-V modules.
Package: libcommon-clang-dev
Package: libopencl-clang-dev
Architecture: all
Depends: ${misc:Depends},
libcommon-clang8 (>= ${source:Version}),
libcommon-clang8 (<< ${source:Upstream-Version}+1~)
libopencl-clang8 (>= ${source:Version}),
libopencl-clang8 (<< ${source:Upstream-Version}+1~)
Description: thin wrapper for clang -- development files
Opencl-clang is a thin wrapper library around clang. It has an
OpenCL-oriented API and is capable of compiling OpenCL C kernels
......
usr/lib/libcommon_clang.so.*
usr/lib/libcommon_clang.so
usr/lib/libopencl-clang.so
usr/include
usr/lib/libopencl-clang.so.*
From 0e12ee904bbbb9e3bcfd3b2e0c9d4d2d715166f0 Mon Sep 17 00:00:00 2001
From: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
Date: Fri, 5 Apr 2019 06:15:52 -0700
Subject: [PATCH] dlopen() soname instead of linker name
Fixes: #60
Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f1c7634..43b9ec4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -144,7 +144,7 @@ add_definitions( -D__STDC_LIMIT_MACROS )
add_definitions( -D__STDC_CONSTANT_MACROS )
add_definitions( -DCOMMON_CLANG_EXPORTS )
if (NOT WIN32)
- add_definitions( -DLIBCOMMON_CLANG_NAME="lib${COMMON_CLANG_LIBRARY_NAME}.so")
+ add_definitions(-DLIBCOMMON_CLANG_NAME="lib${COMMON_CLANG_LIBRARY_NAME}.so.${LLVM_VERSION_MAJOR}")
endif()
#
dlopen-soname.diff
......@@ -9,6 +9,7 @@ override_dh_auto_configure:
dh_auto_configure -- \
-DLLVMSPIRV_INCLUDED_IN_LLVM=OFF \
-DSPIRV_TRANSLATOR_DIR=/usr/lib \
-DCOMMON_CLANG_LIBRARY_NAME=opencl-clang \
-DCMAKE_SKIP_RPATH=true
override_dh_missing:
......
version=4
opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%intel-opencl-clang-$1.tar.gz%" \
https://github.com/intel/opencl-clang/tags \
(?:.*?/)?v?(\d[\d.]*)\.tar\.gz
From 29e2813a2ab7d5569860bb07892dfef7b5374d96 Mon Sep 17 00:00:00 2001
From: Yaxun Liu <Yaxun.Liu@amd.com>
Date: Tue, 26 Feb 2019 16:20:41 +0000
Subject: [PATCH] [OpenCL] Fix assertion due to blocks
A recent change caused assertion in CodeGenFunction::EmitBlockCallExpr when a block is called.
There is code
Func = CGM.getOpenCLRuntime().getInvokeFunction(E->getCallee());
getCalleeDecl calls Expr::getReferencedDeclOfCallee, which does not handle
BlockExpr and returns nullptr, which causes isa to assert.
This patch fixes that.
Differential Revision: https://reviews.llvm.org/D58658
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354893 91177308-0d34-0410-b5e6-96231b3b80d8
---
lib/AST/Expr.cpp | 2 ++
test/CodeGenOpenCL/blocks.cl | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index aef1eab..85690c7 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -1358,6 +1358,8 @@ Decl *Expr::getReferencedDeclOfCallee() {
return DRE->getDecl();
if (MemberExpr *ME = dyn_cast<MemberExpr>(CEE))
return ME->getMemberDecl();
+ if (auto *BE = dyn_cast<BlockExpr>(CEE))
+ return BE->getBlockDecl();
return nullptr;
}
diff --git a/test/CodeGenOpenCL/blocks.cl b/test/CodeGenOpenCL/blocks.cl
index ab5a2c6..c3e2685 100644
--- a/test/CodeGenOpenCL/blocks.cl
+++ b/test/CodeGenOpenCL/blocks.cl
@@ -90,6 +90,12 @@ int get42() {
return blockArgFunc(^{return 42;});
}
+// COMMON-LABEL: define {{.*}}@call_block
+// call {{.*}}@__call_block_block_invoke
+int call_block() {
+ return ^int(int num) { return num; } (11);
+}
+
// CHECK-DEBUG: !DIDerivedType(tag: DW_TAG_member, name: "__size"
// CHECK-DEBUG: !DIDerivedType(tag: DW_TAG_member, name: "__align"
--
1.8.3.1
From 0bf34d401984a607c693f090e7722e5fa6c6d1f2 Mon Sep 17 00:00:00 2001
From: Alexey Sotkin <alexey.sotkin@intel.com>
Date: Fri, 1 Feb 2019 13:10:56 +0300
Subject: [PATCH 2/3] Fix Function operand of DebugFunction instruction
In some cases the translator couldn't find the function described by the
DISubprogram by the name. Now we iterate over all functions in the module
untill we find the desired function using DISubprogram::describes() method.
---
lib/SPIRV/LLVMToSPIRVDbgTran.cpp | 17 +++++-----
test/DebugInfo/DebugFunction.ll | 70 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 78 insertions(+), 9 deletions(-)
create mode 100644 test/DebugInfo/DebugFunction.ll
diff --git a/lib/SPIRV/LLVMToSPIRVDbgTran.cpp b/lib/SPIRV/LLVMToSPIRVDbgTran.cpp
index 27c5aa0..3a6504c 100644
--- a/lib/SPIRV/LLVMToSPIRVDbgTran.cpp
+++ b/lib/SPIRV/LLVMToSPIRVDbgTran.cpp
@@ -799,15 +799,14 @@ SPIRVEntry *LLVMToSPIRVDbgTran::transDbgFunction(const DISubprogram *Func) {
Ops.resize(MinOperandCount);
Ops[ScopeLineIdx] = Func->getScopeLine();
- llvm::Function *F = M->getFunction(Func->getName());
- if (!F)
- F = M->getFunction(Func->getLinkageName());
- if (F) {
- SPIRVValue *SPIRVFunc = SPIRVWriter->getTranslatedValue(F);
- assert(SPIRVFunc && "All function must be already translated");
- Ops[FunctionIdIdx] = SPIRVFunc->getId();
- } else {
- Ops[FunctionIdIdx] = getDebugInfoNoneId();
+ Ops[FunctionIdIdx] = getDebugInfoNoneId();
+ for (const llvm::Function &F : M->functions()) {
+ if (Func->describes(&F)) {
+ SPIRVValue *SPIRVFunc = SPIRVWriter->getTranslatedValue(&F);
+ assert(SPIRVFunc && "All function must be already translated");
+ Ops[FunctionIdIdx] = SPIRVFunc->getId();
+ break;
+ }
}
if (DISubprogram *FuncDecl = Func->getDeclaration())
diff --git a/test/DebugInfo/DebugFunction.ll b/test/DebugInfo/DebugFunction.ll
new file mode 100644
index 0000000..785960e
--- /dev/null
+++ b/test/DebugInfo/DebugFunction.ll
@@ -0,0 +1,70 @@
+; Source:
+; float foo(int i) {
+; return i * 3.14;
+; }
+; void kernel k() {
+; float a = foo(2);
+; }
+; Command:
+; clang -x cl -cl-std=c++ -emit-llvm -target spir -gline-tables-only -O0
+
+; RUN: llvm-as %s -o - | llvm-spirv -o %t.spv
+; RUN: llvm-spirv %t.spv -to-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV
+; RUN: llvm-spirv -r %t.spv -o - | llvm-dis -o - | FileCheck %s --check-prefix=CHECK-LLVM
+
+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"
+
+; CHECK-SPIRV: DebugFunction {{.*}} [[foo:[0-9]+]] {{[0-9]+}} {{$}}
+; CHECK-SPIRV: DebugFunction {{.*}} [[k:[0-9]+]] {{[0-9]+}} {{$}}
+
+; CHECK-SPIRV: Function {{[0-9]+}} [[foo]]
+; CHECK-LLVM: define spir_func float @_Z3fooi(i32) #{{[0-9]+}} !dbg !{{[0-9]+}} {
+define dso_local spir_func float @_Z3fooi(i32) #0 !dbg !9 {
+ %2 = alloca i32, align 4
+ store i32 %0, i32* %2, align 4
+ %3 = load i32, i32* %2, align 4, !dbg !12
+ %4 = sitofp i32 %3 to double, !dbg !12
+ %5 = fmul double %4, 3.140000e+00, !dbg !13
+ %6 = fptrunc double %5 to float, !dbg !12
+ ret float %6, !dbg !14
+}
+
+; CHECK-SPIRV: Function {{[0-9]+}} [[k]]
+; CHECK-LLVM: define spir_kernel void @_Z1kv() #{{[0-9]+}} !dbg !{{[0-9]+}}
+define dso_local spir_kernel void @_Z1kv() #1 !dbg !15 !kernel_arg_addr_space !2 !kernel_arg_access_qual !2 !kernel_arg_type !2 !kernel_arg_base_type !2 !kernel_arg_type_qual !2 {
+ %1 = alloca float, align 4
+ %2 = call spir_func float @_Z3fooi(i32 2) #2, !dbg !16
+ store float %2, float* %1, align 4, !dbg !17
+ ret void, !dbg !18
+}
+
+attributes #0 = { convergent noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "denorms-are-zero"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #1 = { convergent noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "denorms-are-zero"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "uniform-work-group-size"="true" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #2 = { convergent }
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!3, !4, !5}
+!opencl.ocl.version = !{!6}
+!opencl.spir.version = !{!7}
+!llvm.ident = !{!8}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 9.0.0 (trunk 354644)", isOptimized: false, runtimeVersion: 0, emissionKind: LineTablesOnly, enums: !2, nameTableKind: None)
+!1 = !DIFile(filename: "/tmp/compiler-explorer-compiler119127-62-o5mw53.ko2sg/example.cpp", directory: "/tmp/compiler-explorer-compiler119127-62-o5mw53.ko2sg")
+!2 = !{}
+!3 = !{i32 2, !"Dwarf Version", i32 4}
+!4 = !{i32 2, !"Debug Info Version", i32 3}
+!5 = !{i32 1, !"wchar_size", i32 4}
+!6 = !{i32 0, i32 0}
+!7 = !{i32 0, i32 2}
+!8 = !{!"clang version 9.0.0 (trunk 354644)"}
+!9 = distinct !DISubprogram(name: "foo", scope: !10, file: !10, line: 2, type: !11, scopeLine: 2, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
+!10 = !DIFile(filename: "example.cpp", directory: "/tmp/compiler-explorer-compiler119127-62-o5mw53.ko2sg")
+!11 = !DISubroutineType(types: !2)
+!12 = !DILocation(line: 3, column: 12, scope: !9)
+!13 = !DILocation(line: 3, column: 14, scope: !9)
+!14 = !DILocation(line: 3, column: 5, scope: !9)
+!15 = distinct !DISubprogram(name: "k", scope: !10, file: !10, line: 6, type: !11, scopeLine: 6, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
+!16 = !DILocation(line: 7, column: 15, scope: !15)
+!17 = !DILocation(line: 7, column: 11, scope: !15)
+!18 = !DILocation(line: 8, column: 1, scope: !15)
--
1.8.3.1
From d1857bd941bd48b8b3d9a861891f11b4a3ca3f05 Mon Sep 17 00:00:00 2001
From: Alexey Sotkin <alexey.sotkin@intel.com>
Date: Tue, 26 Feb 2019 17:51:29 +0300
Subject: [PATCH 3/3] Fix Parent operand of DebugFunction instruction
Even if the 'scope' operand of DISubprogram in LLVM IR points to a DIFile, in
SPIRV we should point to DebugCompilationUnit instead. This is to allign the
implementaion with SPIRV debug info specification.
---
lib/SPIRV/LLVMToSPIRVDbgTran.cpp | 6 +++++-
test/DebugInfo/DebugFunction.ll | 17 +++++++++++++----
2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/lib/SPIRV/LLVMToSPIRVDbgTran.cpp b/lib/SPIRV/LLVMToSPIRVDbgTran.cpp
index 3a6504c..468320a 100644
--- a/lib/SPIRV/LLVMToSPIRVDbgTran.cpp
+++ b/lib/SPIRV/LLVMToSPIRVDbgTran.cpp
@@ -786,7 +786,11 @@ SPIRVEntry *LLVMToSPIRVDbgTran::transDbgFunction(const DISubprogram *Func) {
Ops[SourceIdx] = getSource(Func)->getId();
Ops[LineIdx] = Func->getLine();
Ops[ColumnIdx] = 0; // This version of DISubprogram has no column number
- Ops[ParentIdx] = getScope(Func->getScope())->getId();
+ auto Scope = Func->getScope();
+ if (Scope && isa<DIFile>(Scope))
+ Ops[ParentIdx] = SPIRVCU->getId();
+ else
+ Ops[ParentIdx] = getScope(Scope)->getId();
Ops[LinkageNameIdx] = BM->getString(Func->getLinkageName())->getId();
Ops[FlagsIdx] = transDebugFlags(Func);
diff --git a/test/DebugInfo/DebugFunction.ll b/test/DebugInfo/DebugFunction.ll
index 785960e..94bd46d 100644
--- a/test/DebugInfo/DebugFunction.ll
+++ b/test/DebugInfo/DebugFunction.ll
@@ -1,3 +1,9 @@
+; Check for 2 thigs:
+; - After round trip translation function definition has !dbg metadata attached
+; specifically if -gline-tables-only was used for Clang
+; - Parent operand of DebugFunction is DebugCompileUnit, not an OpString, even
+; if in LLVM IR it points to a DIFile instead of DICompileUnit.
+
; Source:
; float foo(int i) {
; return i * 3.14;
@@ -15,10 +21,13 @@
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"
-; CHECK-SPIRV: DebugFunction {{.*}} [[foo:[0-9]+]] {{[0-9]+}} {{$}}
-; CHECK-SPIRV: DebugFunction {{.*}} [[k:[0-9]+]] {{[0-9]+}} {{$}}
+; CHECK-SPIRV: String [[foo:[0-9]+]] "foo"
+; CHECK-SPIRV: String [[k:[0-9]+]] "k"
+; CHECK-SPIRV: [[CU:[0-9]+]] {{[0-9]+}} DebugCompileUnit
+; CHECK-SPIRV: DebugFunction [[foo]] {{.*}} [[CU]] {{.*}} [[foo_id:[0-9]+]] {{[0-9]+}} {{$}}
+; CHECK-SPIRV: DebugFunction [[k]] {{.*}} [[CU]] {{.*}} [[k_id:[0-9]+]] {{[0-9]+}} {{$}}
-; CHECK-SPIRV: Function {{[0-9]+}} [[foo]]
+; CHECK-SPIRV: Function {{[0-9]+}} [[foo_id]]
; CHECK-LLVM: define spir_func float @_Z3fooi(i32) #{{[0-9]+}} !dbg !{{[0-9]+}} {
define dso_local spir_func float @_Z3fooi(i32) #0 !dbg !9 {
%2 = alloca i32, align 4
@@ -30,7 +39,7 @@ define dso_local spir_func float @_Z3fooi(i32) #0 !dbg !9 {
ret float %6, !dbg !14
}
-; CHECK-SPIRV: Function {{[0-9]+}} [[k]]
+; CHECK-SPIRV: Function {{[0-9]+}} [[k_id]]
; CHECK-LLVM: define spir_kernel void @_Z1kv() #{{[0-9]+}} !dbg !{{[0-9]+}}
define dso_local spir_kernel void @_Z1kv() #1 !dbg !15 !kernel_arg_addr_space !2 !kernel_arg_access_qual !2 !kernel_arg_type !2 !kernel_arg_base_type !2 !kernel_arg_type_qual !2 {
%1 = alloca float, align 4
--
1.8.3.1