Skip to content

Commit 64daf45

Browse files
committed
[SYCL][NVPTX] Use ptx_kernel cc instead of metadata
llvm/llvm-project@4583f6d3443c switch to use ptx_kernel cc instead of metadata to mark kernels. Update TargetHelpers /SYCLCreateNVVMAnnotations and tests.
1 parent 87c57b3 commit 64daf45

18 files changed

+101
-142
lines changed

llvm/lib/SYCLLowerIR/SYCLCreateNVVMAnnotations.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@
1717

1818
using namespace llvm;
1919

20-
static void addNVVMMetadata(GlobalValue &GV, StringRef Name, int Operand) {
21-
Module *M = GV.getParent();
20+
static void addNVVMMetadata(Function &F, StringRef Name, int Operand) {
21+
Module *M = F.getParent();
2222
LLVMContext &Ctx = M->getContext();
2323

2424
// Get "nvvm.annotations" metadata node
2525
NamedMDNode *MD = M->getOrInsertNamedMetadata("nvvm.annotations");
2626

27-
Metadata *MDVals[] = {ConstantAsMetadata::get(&GV), MDString::get(Ctx, Name),
27+
Metadata *MDVals[] = {ConstantAsMetadata::get(&F), MDString::get(Ctx, Name),
2828
ConstantAsMetadata::get(
2929
ConstantInt::get(Type::getInt32Ty(Ctx), Operand))};
3030
// Append metadata to nvvm.annotations
31+
F.setCallingConv(CallingConv::PTX_Kernel);
3132
MD->addOperand(MDNode::get(Ctx, MDVals));
3233
}
3334

llvm/lib/SYCLLowerIR/TargetHelpers.cpp

Lines changed: 14 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,7 @@ void KernelCache::handleNewCloneOf(Function &OldF, Function &NewF,
4343
bool KernelOnly) {
4444
assert(KernelData.contains(&OldF) && "Unknown kernel");
4545
if (auto &KP = KernelData[&OldF]; KP.hasAnnotations()) {
46-
if (KernelOnly) {
47-
// We know this is a kernel, so add a single "kernel" annotation.
48-
auto &Ctx = OldF.getContext();
49-
Metadata *NewKernelMD[] = {
50-
ConstantAsMetadata::get(&NewF), MDString::get(Ctx, "kernel"),
51-
ConstantAsMetadata::get(ConstantInt::get(Type::getInt32Ty(Ctx), 1))};
52-
KP.ModuleAnnotationsMD->addOperand(MDNode::get(Ctx, NewKernelMD));
53-
} else {
46+
if (!KernelOnly) {
5447
// Otherwise we'll need to clone all metadata, possibly dropping ones
5548
// which we can't assume are safe to clone.
5649
llvm_unreachable("Unimplemented cloning logic");
@@ -73,12 +66,16 @@ void KernelCache::populateKernels(Module &M) {
7366
return;
7467
}
7568

76-
// NVPTX kernels are identified by the global annotations metadata.
69+
// NVPTX kernels are identified by their calling convention, and may have
70+
// annotations.
7771
if (T.isNVPTX()) {
78-
// Access `nvvm.annotations` to determine which functions are kernel
79-
// entry points.
8072
auto *AnnotationMetadata = M.getNamedMetadata("nvvm.annotations");
81-
// No kernels in the module, early exit.
73+
for (auto &F : M) {
74+
if (F.getCallingConv() == CallingConv::PTX_Kernel) {
75+
Kernels.push_back(&F);
76+
KernelData[&F] = KernelPayload{AnnotationMetadata};
77+
}
78+
}
8279
if (!AnnotationMetadata)
8380
return;
8481

@@ -93,36 +90,17 @@ void KernelCache::populateKernels(Module &M) {
9390

9491
Visited.insert(MDN);
9592

96-
// Kernel entry points are identified using metadata nodes of the form:
97-
// !X = !{<function>[, !"kind", i32 X]+}
98-
// Where "kind" == "kernel" and X == 1.
99-
bool IsKernel = false;
100-
for (size_t I = 1, E = MDN->getNumOperands() - 1; I < E && !IsKernel;
101-
I += 2) {
102-
if (auto *Type = dyn_cast<MDString>(MDN->getOperand(I)))
103-
if (Type->getString() == "kernel") {
104-
if (auto *Val =
105-
mdconst::dyn_extract<ConstantInt>(MDN->getOperand(I + 1)))
106-
IsKernel = Val->getZExtValue() == 1;
107-
}
108-
}
109-
11093
// Get a pointer to the entry point function from the metadata.
11194
const MDOperand &FuncOperand = MDN->getOperand(0);
11295
if (!FuncOperand)
11396
continue;
11497

115-
if (auto *FuncConstant = dyn_cast<ConstantAsMetadata>(FuncOperand)) {
116-
if (auto *Func = dyn_cast<Function>(FuncConstant->getValue())) {
117-
if (IsKernel && !KernelData.contains(Func)) {
118-
Kernels.push_back(Func);
119-
KernelData[Func] = KernelPayload{AnnotationMetadata};
120-
}
121-
DependentMDNodes[Func].push_back(MDN);
122-
}
123-
}
98+
if (auto *FuncConstant = dyn_cast<ConstantAsMetadata>(FuncOperand))
99+
if (auto *Func = dyn_cast<Function>(FuncConstant->getValue()))
100+
if (Func->getCallingConv() == CallingConv::PTX_Kernel)
101+
DependentMDNodes[Func].push_back(MDN);
124102
}
125-
103+
126104
// We need to match non-kernel metadata nodes using the kernel name to the
127105
// kernel nodes. To avoid checking matched nodes multiple times keep track
128106
// of handled entries.

llvm/test/CodeGen/NVPTX/global-offset-annotations.ll

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
target datalayout = "e-i64:64-i128:128-v16:16-v32:32-n16:32:64"
44
target triple = "nvptx64-nvidia-cuda"
55

6-
; This test checks that the transformation is applied to kernels found using
7-
; less common annotation formats, and that annotations are correctly updated.
8-
; We don't currently know it's safe to clone all metadata, so only add a
9-
; "kernel" annotation and leave others in place.
6+
; This test checks that the transformation is applied to kernels found
107

118
declare ptr @llvm.nvvm.implicit.offset()
129
; CHECK-NOT: llvm.nvvm.implicit.offset
@@ -25,14 +22,13 @@ entry:
2522
ret void
2623
}
2724

28-
; CHECK: !nvvm.annotations = !{![[OLDMD0:[0-9]+]], ![[OLDMD1:[0-9]+]], ![[OLDMD1]], ![[OLDMD0]], ![[NEWKERNELMD:[0-9]+]]}
25+
; CHECK: !nvvm.annotations = !{![[OLDMD0:[0-9]+]], ![[OLDMD1:[0-9]+]], ![[OLDMD1]], ![[OLDMD0]]}
2926

3027
!llvm.module.flags = !{!0}
3128
!nvvm.annotations = !{!1, !2, !2, !1}
3229

3330
; CHECK: ![[OLDMD0]] = distinct !{ptr @_ZTS14example_kernel, !"maxnreg", i32 256, !"kernel", i32 1}
3431
; CHECK: ![[OLDMD1]] = !{ptr @_ZTS14example_kernel, !"maxntidx", i32 8, !"maxntidy", i32 16, !"maxntidz", i32 32}
35-
; CHECK: ![[NEWKERNELMD]] = !{ptr @_ZTS14example_kernel_with_offset, !"kernel", i32 1}
3632

3733
!0 = !{i32 1, !"sycl-device", i32 1}
3834
!1 = distinct !{ptr @_ZTS14example_kernel, !"maxnreg", i32 256, !"kernel", i32 1}

llvm/test/CodeGen/NVPTX/global-offset-dbg.ll

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,40 @@ target triple = "nvptx64-nvidia-cuda"
88

99
declare ptr @llvm.nvvm.implicit.offset()
1010

11-
define i64 @_ZTS14other_function() !dbg !11 {
11+
define i64 @_ZTS14other_function() !dbg !10 {
1212
%1 = tail call ptr @llvm.nvvm.implicit.offset()
1313
%2 = getelementptr inbounds i32, ptr %1, i64 2
1414
%3 = load i32, ptr %2, align 4
1515
%4 = zext i32 %3 to i64
1616
ret i64 %4
1717
}
1818

19-
define void @_ZTS14example_kernel() !dbg !14 {
19+
define ptx_kernel void @_ZTS14example_kernel() !dbg !13 {
2020
entry:
21-
%0 = call i64 @_ZTS14other_function(), !dbg !15
21+
%0 = call i64 @_ZTS14other_function(), !dbg !14
2222
ret void
2323
}
2424

2525
!llvm.dbg.cu = !{!0}
26-
!llvm.module.flags = !{!3, !4, !10}
27-
!nvvm.annotations = !{!5, !6, !7, !6, !8, !8, !8, !8, !9, !9, !8}
28-
!nvvmir.version = !{!6}
26+
!llvm.module.flags = !{!3, !4, !9}
27+
!nvvm.annotations = !{!5, !6, !5, !7, !7, !7, !7, !8, !8, !7}
28+
!nvvmir.version = !{!5}
2929

3030
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 0.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
3131
!1 = !DIFile(filename: "global-offset-debug.cpp", directory: "/tmp")
3232
!2 = !{}
3333
!3 = !{i32 2, !"Dwarf Version", i32 4}
3434
!4 = !{i32 2, !"Debug Info Version", i32 3}
35-
!5 = distinct !{ptr @_ZTS14example_kernel, !"kernel", i32 1}
36-
!6 = !{i32 1, i32 4}
37-
!7 = !{null, !"align", i32 8, !"align", i32 65544, !"align", i32 131080}
38-
!8 = !{null, !"align", i32 16}
39-
!9 = !{null, !"align", i32 16, !"align", i32 65552, !"align", i32 131088}
40-
!10 = !{i32 1, !"sycl-device", i32 1}
41-
!11 = distinct !DISubprogram(name: "other_function", scope: !1, file: !1, line: 3, type: !12, scopeLine: 3, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
42-
!12 = !DISubroutineType(types: !13)
43-
!13 = !{null}
44-
!14 = distinct !DISubprogram(name: "example_kernel", scope: !1, file: !1, line: 10, type: !12, scopeLine: 10, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
45-
!15 = !DILocation(line: 1, column: 2, scope: !14)
35+
!5 = !{i32 1, i32 4}
36+
!6 = !{null, !"align", i32 8, !"align", i32 65544, !"align", i32 131080}
37+
!7 = !{null, !"align", i32 16}
38+
!8 = !{null, !"align", i32 16, !"align", i32 65552, !"align", i32 131088}
39+
!9 = !{i32 1, !"sycl-device", i32 1}
40+
!10 = distinct !DISubprogram(name: "other_function", scope: !1, file: !1, line: 3, type: !11, scopeLine: 3, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
41+
!11 = !DISubroutineType(types: !12)
42+
!12 = !{null}
43+
!13 = distinct !DISubprogram(name: "example_kernel", scope: !1, file: !1, line: 10, type: !11, scopeLine: 10, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
44+
!14 = !DILocation(line: 1, column: 2, scope: !13)
4645
; CHECK-LABEL: define i64 @_ZTS14other_function(
4746
; CHECK-SAME: ) !dbg [[DBG12:![0-9]+]] {
4847
; CHECK-NEXT: [[TMP1:%.*]] = zext i32 0 to i64
@@ -57,14 +56,14 @@ entry:
5756
; CHECK-NEXT: ret i64 [[TMP4]]
5857
;
5958
;
60-
; CHECK-LABEL: define void @_ZTS14example_kernel(
59+
; CHECK-LABEL: define ptx_kernel void @_ZTS14example_kernel(
6160
; CHECK-SAME: ) !dbg [[DBG16:![0-9]+]] {
6261
; CHECK-NEXT: [[ENTRY:.*:]]
6362
; CHECK-NEXT: [[TMP0:%.*]] = call i64 @_ZTS14other_function(), !dbg [[DBG17:![0-9]+]]
6463
; CHECK-NEXT: ret void
6564
;
6665
;
67-
; CHECK-LABEL: define void @_ZTS14example_kernel_with_offset(
66+
; CHECK-LABEL: define ptx_kernel void @_ZTS14example_kernel_with_offset(
6867
; CHECK-SAME: ptr byval([3 x i32]) [[TMP0:%.*]]) !dbg [[DBG18:![0-9]+]] {
6968
; CHECK-NEXT: [[ENTRY:.*:]]
7069
; CHECK-NEXT: [[TMP1:%.*]] = call i64 @_ZTS14other_function_with_offset(ptr [[TMP0]]), !dbg [[DBG19:![0-9]+]]
@@ -77,12 +76,10 @@ entry:
7776
; CHECK: [[META3:![0-9]+]] = !{i32 2, !"Dwarf Version", i32 4}
7877
; CHECK: [[META4:![0-9]+]] = !{i32 2, !"Debug Info Version", i32 3}
7978
; CHECK: [[META5:![0-9]+]] = !{i32 1, !"sycl-device", i32 1}
80-
; CHECK: [[META6:![0-9]+]] = distinct !{ptr @_ZTS14example_kernel, !"kernel", i32 1}
8179
; CHECK: [[META7:![0-9]+]] = !{i32 1, i32 4}
8280
; CHECK: [[META8:![0-9]+]] = !{null, !"align", i32 8, !"align", i32 65544, !"align", i32 131080}
8381
; CHECK: [[META9:![0-9]+]] = !{null, !"align", i32 16}
8482
; CHECK: [[META10:![0-9]+]] = !{null, !"align", i32 16, !"align", i32 65552, !"align", i32 131088}
85-
; CHECK: [[META11:![0-9]+]] = !{ptr @_ZTS14example_kernel_with_offset, !"kernel", i32 1}
8683
; CHECK: [[DBG12]] = distinct !DISubprogram(name: "other_function", scope: [[META1]], file: [[META1]], line: 3, type: [[META13:![0-9]+]], scopeLine: 3, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: [[META0]], retainedNodes: [[META2]])
8784
; CHECK: [[META13]] = !DISubroutineType(types: [[META14:![0-9]+]])
8885
; CHECK: [[META14]] = !{null}

llvm/test/CodeGen/NVPTX/global-offset-intrinsic-function-mix.ll

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,28 +47,27 @@ define i64 @_ZTS14mixed_function() {
4747
; CHECK: %5 = zext i32 %4 to i64
4848
; CHECK: ret i64 %2
4949

50-
define void @_ZTS12some_kernel() {
50+
define ptx_kernel void @_ZTS12some_kernel() {
5151
entry:
5252
%0 = call i64 @_ZTS14mixed_function()
5353
; CHECK: %0 = call i64 @_ZTS14mixed_function()
5454
ret void
5555
}
5656

57-
; CHECK: define void @_ZTS12some_kernel_with_offset(ptr byval([3 x i32]) %0) {
57+
; Check cc in our new kernel
58+
; CHECK: define ptx_kernel void @_ZTS12some_kernel_with_offset(ptr byval([3 x i32]) %0) {
5859
; CHECK: entry:
5960
; CHECK: %1 = call i64 @_ZTS14mixed_function_with_offset(ptr %0)
6061
; CHECK: ret void
6162
; CHECK: }
6263

63-
; Check the last annotation is our new kernel
64-
; CHECK: !nvvm.annotations = {{.*}}, ![[NEWKERNELMD:[0-9]+]]}
64+
; CHECK: !nvvm.annotations = {{.*}}
6565

6666
!llvm.module.flags = !{!6}
6767
!nvvm.annotations = !{!0, !1, !2, !1, !3, !3, !3, !3, !4, !4, !3, !5}
6868
!nvvmir.version = !{!5}
6969

70-
; CHECK: ![[NEWKERNELMD]] = !{ptr @_ZTS12some_kernel_with_offset, !"kernel", i32 1}
71-
!0 = distinct !{ptr @_ZTS12some_kernel, !"kernel", i32 1}
70+
!0 = distinct !{ptr @_ZTS12some_kernel, !"dummy", i32 1}
7271
!1 = !{null, !"align", i32 8}
7372
!2 = !{null, !"align", i32 8, !"align", i32 65544, !"align", i32 131080}
7473
!3 = !{null, !"align", i32 16}

llvm/test/CodeGen/NVPTX/global-offset-multiple-calls-from-one-function.ll

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ define i64 @_ZTS14other_function() {
4343
; CHECK: ret i64 %4
4444
; CHECK: }
4545

46-
define void @_ZTS14example_kernel() {
46+
define ptx_kernel void @_ZTS14example_kernel() {
4747
entry:
4848
%0 = call i64 @_ZTS14other_function()
4949
; CHECK: %0 = call i64 @_ZTS14other_function()
@@ -52,22 +52,20 @@ entry:
5252
ret void
5353
}
5454

55-
; CHECK: define void @_ZTS14example_kernel_with_offset(ptr byval([3 x i32]) %0) {
55+
; CHECK: define ptx_kernel void @_ZTS14example_kernel_with_offset(ptr byval([3 x i32]) %0) {
5656
; CHECK: entry:
5757
; CHECK: %1 = call i64 @_ZTS14other_function_with_offset(ptr %0)
5858
; CHECK: %2 = call i64 @_ZTS14other_function_with_offset(ptr %0)
5959
; CHECK: ret void
6060
; CHECK: }
6161

62-
; Check the last annotation is our new kernel
63-
; CHECK: !nvvm.annotations = {{.*}}, ![[NEWKERNELMD:[0-9]+]]}
62+
; CHECK: !nvvm.annotations = {{.*}}
6463

6564
!llvm.module.flags = !{!7}
6665
!nvvm.annotations = !{!0, !1, !2, !1, !3, !3, !3, !3, !4, !4, !3}
6766
!nvvmir.version = !{!6}
6867

69-
; CHECK: ![[NEWKERNELMD]] = !{ptr @_ZTS14example_kernel_with_offset, !"kernel", i32 1}
70-
!0 = distinct !{ptr @_ZTS14example_kernel, !"kernel", i32 1}
68+
!0 = distinct !{ptr @_ZTS14example_kernel, !"dummy", i32 1}
7169
!1 = !{null, !"align", i32 8}
7270
!2 = !{null, !"align", i32 8, !"align", i32 65544, !"align", i32 131080}
7371
!3 = !{null, !"align", i32 16}

llvm/test/CodeGen/NVPTX/global-offset-multiple-entry-points.ll

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ declare ptr @llvm.nvvm.implicit.offset()
1111

1212
; This function is a kernel entry point that does not use global offset. It will
1313
; not get a clone with a global offset parameter.
14-
define dso_local void @_ZTS12third_kernel() {
14+
define dso_local ptx_kernel void @_ZTS12third_kernel() {
1515
entry:
1616
ret void
1717
}
@@ -45,14 +45,14 @@ define i64 @_ZTS14first_function() {
4545
; CHECK: %2 = call i64 @_ZTS15common_function_with_offset(ptr %0)
4646
; CHECK: ret i64 %2
4747

48-
define void @_ZTS12first_kernel() {
48+
define ptx_kernel void @_ZTS12first_kernel() {
4949
entry:
5050
%0 = call i64 @_ZTS14first_function()
5151
; CHECK: %0 = call i64 @_ZTS14first_function()
5252
ret void
5353
}
5454

55-
; CHECK: define void @_ZTS12first_kernel_with_offset(ptr byval([3 x i32]) %0) {
55+
; CHECK: define ptx_kernel void @_ZTS12first_kernel_with_offset(ptr byval([3 x i32]) %0) {
5656
; CHECK: entry:
5757
; CHECK: %1 = call i64 @_ZTS14first_function_with_offset(ptr %0)
5858
; CHECK: ret void
@@ -69,14 +69,14 @@ define i64 @_ZTS15second_function() {
6969
; CHECK: %2 = call i64 @_ZTS15common_function_with_offset(ptr %0)
7070
; CHECK: ret i64 %2
7171

72-
define void @_ZTS13second_kernel() {
72+
define ptx_kernel void @_ZTS13second_kernel() {
7373
entry:
7474
%0 = call i64 @_ZTS15second_function()
7575
; CHECK: %0 = call i64 @_ZTS15second_function()
7676
ret void
7777
}
7878

79-
; CHECK: define void @_ZTS13second_kernel_with_offset(ptr byval([3 x i32]) %0) {
79+
; CHECK: define ptx_kernel void @_ZTS13second_kernel_with_offset(ptr byval([3 x i32]) %0) {
8080
; CHECK: entry:
8181
; CHECK: %1 = call i64 @_ZTS15second_function_with_offset(ptr %0)
8282
; CHECK: ret void
@@ -102,21 +102,18 @@ define i64 @_ZTS15no_entry_point() {
102102
; CHECK: }
103103

104104
; Check the last two annotations are our new kernels
105-
; CHECK: !nvvm.annotations = {{.*}}, ![[NEWKERNEL0MD:[0-9]+]], ![[NEWKERNEL1MD:[0-9]+]]}
105+
; CHECK: !nvvm.annotations = {{.*}}
106106

107107
!llvm.module.flags = !{!10}
108108
!nvvm.annotations = !{!0, !1, !2, !1, !3, !3, !3, !3, !4, !4, !3, !5, !6}
109109
!nvvmir.version = !{!9}
110110

111-
; CHECK: ![[NEWKERNEL0MD]] = !{ptr @_ZTS13second_kernel_with_offset, !"kernel", i32 1}
112-
; CHECK: ![[NEWKERNEL1MD]] = !{ptr @_ZTS12first_kernel_with_offset, !"kernel", i32 1}
113-
114-
!0 = distinct !{ptr @_ZTS12first_kernel, !"kernel", i32 1}
111+
!0 = distinct !{ptr @_ZTS12first_kernel, !"dummy", i32 1}
115112
!1 = !{null, !"align", i32 8}
116113
!2 = !{null, !"align", i32 8, !"align", i32 65544, !"align", i32 131080}
117114
!3 = !{null, !"align", i32 16}
118115
!4 = !{null, !"align", i32 16, !"align", i32 65552, !"align", i32 131088}
119-
!5 = distinct !{ptr @_ZTS13second_kernel, !"kernel", i32 1}
120-
!6 = distinct !{ptr @_ZTS12third_kernel, !"kernel", i32 1}
116+
!5 = distinct !{ptr @_ZTS13second_kernel, !"dummy", i32 1}
117+
!6 = distinct !{ptr @_ZTS12third_kernel, !"dummy", i32 1}
121118
!9 = !{i32 1, i32 4}
122119
!10 = !{i32 1, !"sycl-device", i32 1}

llvm/test/CodeGen/NVPTX/global-offset-simple.ll

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,26 @@ define i64 @_ZTS14other_function() {
2626
; CHECK: ret i64 %4
2727
; CHECK: }
2828

29-
define void @_ZTS14example_kernel() {
29+
define ptx_kernel void @_ZTS14example_kernel() {
3030
entry:
3131
%0 = call i64 @_ZTS14other_function()
3232
; CHECK: %0 = call i64 @_ZTS14other_function()
3333
ret void
3434
}
3535

36-
; CHECK: define void @_ZTS14example_kernel_with_offset(ptr byval([3 x i32]) %0) {
36+
; CHECK: define ptx_kernel void @_ZTS14example_kernel_with_offset(ptr byval([3 x i32]) %0) {
3737
; CHECK: entry:
3838
; CHECK: %1 = call i64 @_ZTS14other_function_with_offset(ptr %0)
3939
; CHECK: ret void
4040
; CHECK: }
4141

42-
; Check the last annotation is our new kernel
43-
; CHECK: !nvvm.annotations = {{.*}}, ![[NEWKERNELMD:[0-9]+]]}
42+
; CHECK: !nvvm.annotations = {{.*}}
4443

4544
!llvm.module.flags = !{!7}
4645
!nvvm.annotations = !{!0, !1, !2, !1, !3, !3, !3, !3, !4, !4, !3}
4746
!nvvmir.version = !{!6}
4847

49-
; CHECK: ![[NEWKERNELMD]] = !{ptr @_ZTS14example_kernel_with_offset, !"kernel", i32 1}
50-
!0 = distinct !{ptr @_ZTS14example_kernel, !"kernel", i32 1}
48+
!0 = distinct !{ptr @_ZTS14example_kernel, !"dummy", i32 1}
5149
!1 = !{null, !"align", i32 8}
5250
!2 = !{null, !"align", i32 8, !"align", i32 65544, !"align", i32 131080}
5351
!3 = !{null, !"align", i32 16}

0 commit comments

Comments
 (0)