Skip to content

Commit 0e3404e

Browse files
authored
[OpaquePointers] XFAIL annotation_dbg_info_drop.ll (#2083)
It should be compiltely rewritten Signed-off-by: Sidorov, Dmitry <[email protected]>
1 parent 5d400f8 commit 0e3404e

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

test/transcoding/annotation_dbg_info_drop.ll

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
; RUN: llvm-as -opaque-pointers=0 %s -o %t.bc
2-
; RUN: llvm-spirv %t.bc -opaque-pointers=0 -o %t.spv
1+
; RUN: llvm-as %s -o %t.bc
2+
; RUN: llvm-spirv %t.bc -o %t.spv
33
; RUN: llvm-spirv %t.spv --to-text -o %t.spt
44
; RUN: FileCheck < %t.spt %s --check-prefixes=CHECK,CHECK-SPV
55

6-
; RUN: llvm-spirv %t.bc -opaque-pointers=0 --spirv-ext=+SPV_INTEL_fpga_reg -o %t.fpga_reg.spv
6+
; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_INTEL_fpga_reg -o %t.fpga_reg.spv
77
; RUN: llvm-spirv %t.fpga_reg.spv --to-text -o %t.fpga_reg.spt
88
; RUN: FileCheck < %t.fpga_reg.spt %s --check-prefixes=CHECK,CHECK-SPV-FPGA_REG
99

10+
; need to rewrite the entire test since with opaque pointers a lot of bitcasts
11+
; are being eliminated, and those bitcasts were carrying debug information
12+
; XFAIL: *
13+
1014
; -- Check that reverse translation is not failed.
11-
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.rev.bc
12-
; RUN: llvm-spirv -r -emit-opaque-pointers %t.fpga_reg.spv -o %t.rev.fpga_reg.bc
15+
; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
16+
; RUN: llvm-spirv -r %t.fpga_reg.spv -o %t.rev.fpga_reg.bc
1317

1418
; ModuleID = 'annotation_dbg_info_drop.cpp'
1519
source_filename = "annotation_dbg_info_drop.cpp"
@@ -60,10 +64,9 @@ entry:
6064
call void @llvm.lifetime.start.p0i8(i64 1, i8* %0) #5, !dbg !72
6165
call void @llvm.dbg.declare(metadata [1 x i8]* %Buf, metadata !52, metadata !DIExpression()), !dbg !73
6266
%Buf2 = bitcast [1 x i8]* %Buf to i8*, !dbg !72
63-
call void @llvm.var.annotation(i8* %Buf2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i32 0, i32 0), i32 15, i8* null), !dbg !72
67+
call void @llvm.var.annotation(i8* %Buf2, i8* bitcast ([25 x i8]* @.str to i8*), i8* bitcast ([29 x i8]* @.str.1 to i8*), i32 15, i8* null), !dbg !72
6468
; CHECK: {{[0-9]+}} ExtInst {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} DebugNoScope
65-
; CHECK-NEXT: {{[0-9]+}} InBoundsPtrAccessChain {{[0-9]+}} {{[0-9]+}} [[ANNO_PUMP_ID]]
66-
; CHECK-NEXT: {{[0-9]+}} InBoundsPtrAccessChain {{[0-9]+}} {{[0-9]+}} [[FILE_ID]]
69+
; CHECK-NEXT: Load
6770
call spir_func void @_Z1fv(), !dbg !74
6871
; -- var.annotation call is dropped. Restore debug scope after the call.
6972
; CHECK-NEXT: {{[0-9]+}} ExtInst {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} DebugScope
@@ -77,9 +80,9 @@ entry:
7780
call void @llvm.lifetime.start.p0i8(i64 4, i8* %2) #5, !dbg !79
7881
call void @llvm.dbg.declare(metadata i32* %b, metadata !54, metadata !DIExpression()), !dbg !80
7982
%3 = load i32, i32* %a, align 4, !dbg !81, !tbaa !77
80-
%4 = call i32 @llvm.annotation.i32(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i32 0, i32 0), i32 18), !dbg !82
83+
%4 = call i32 @llvm.annotation.i32(i32 %3, i8* bitcast ([25 x i8]* @.str.2 to i8*), i8* bitcast ([29 x i8]* @.str.1 to i8*), i32 18), !dbg !82
8184
; CHECK: {{[0-9]+}} ExtInst {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} DebugNoScope
82-
; CHECK-NEXT: {{[0-9]+}} InBoundsPtrAccessChain {{[0-9]+}} {{[0-9]+}} [[FPGA_REG_ID]]
85+
; CHECK-NEXT: {{[0-9]+}} Bitcast {{[0-9]+}} {{[0-9]+}} [[FPGA_REG_ID]]
8386
store i32 %4, i32* %b, align 4, !dbg !80, !tbaa !77
8487
; -- Restore debug scope after the call in both cases with or without SPV_INTEL_fpga_reg extension.
8588
; CHECK-NEXT: {{[0-9]+}} ExtInst {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} DebugScope
@@ -95,7 +98,7 @@ entry:
9598
; -- annotation call is dropped. No debug scope or line change for first argument declaration.
9699
; CHECK-NEXT: {{[0-9]+}} Load
97100
; CHECK-NEXT: {{[0-9]+}} Line
98-
%8 = call i64 @llvm.annotation.i64(i64 %7, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i32 0, i32 0), i32 19), !dbg !86
101+
%8 = call i64 @llvm.annotation.i64(i64 %7, i8* bitcast ([25 x i8]* @.str.2 to i8*), i8* bitcast ([29 x i8]* @.str.1 to i8*), i32 19), !dbg !86
99102
; CHECK-SPV-FPGA_REG-NEXT: {{[0-9]+}} FPGARegINTEL
100103
store i64 %8, i64* %c, align 8, !dbg !84, !tbaa !39
101104
; CHECK-SPV-NEXT: {{[0-9]+}} Store
@@ -104,9 +107,9 @@ entry:
104107
call void @llvm.dbg.declare(metadata %"struct._ZTSZZZ4mainENK3$_0clERN2cl4sycl7handlerEENKUlvE_clEvE3s_d.s_d"* %d, metadata !56, metadata !DIExpression()), !dbg !88
105108
%mem = getelementptr inbounds %"struct._ZTSZZZ4mainENK3$_0clERN2cl4sycl7handlerEENKUlvE_clEvE3s_d.s_d", %"struct._ZTSZZZ4mainENK3$_0clERN2cl4sycl7handlerEENKUlvE_clEvE3s_d.s_d"* %d, i32 0, i32 0, !dbg !89
106109
%10 = bitcast [8 x i32]* %mem to i8*, !dbg !89
107-
%11 = call i8* @llvm.ptr.annotation.p0i8(i8* %10, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i32 0, i32 0), i32 21, i8* null), !dbg !89
110+
%11 = call i8* @llvm.ptr.annotation.p0i8(i8* %10, i8* bitcast ([29 x i8]* @.str.3 to i8*), i8* bitcast ([29 x i8]* @.str.1 to i8*), i32 21, i8* null), !dbg !89
108111
; CHECK: {{[0-9]+}} ExtInst {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} DebugNoScope
109-
; CHECK-NEXT: {{[0-9]+}} InBoundsPtrAccessChain {{[0-9]+}} {{[0-9]+}} [[ANNO_NUMBANKS_ID]]
112+
; CHECK-NEXT: {{[0-9]+}} Bitcast {{[0-9]+}} {{[0-9]+}} [[ANNO_NUMBANKS_ID]]
110113
%12 = bitcast i8* %11 to [8 x i32]*, !dbg !89
111114
; -- annotation call is dropped. Restore debug scope
112115
; CHECK-NEXT: {{[0-9]+}} ExtInst {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} DebugScope
@@ -125,7 +128,7 @@ entry:
125128
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %15, i8* align 4 %16, i64 16, i1 false), !dbg !96, !tbaa.struct !97
126129
%17 = bitcast %"struct._ZTSZZZ4mainENK3$_0clERN2cl4sycl7handlerEENKUlvE_clEvE3s_e.s_e"* %agg-temp to i8*, !dbg !99
127130
; CHECK: {{[0-9]+}} Bitcast {{[0-9]+}} {{[0-9]+}} [[AGG_TMP_ID]]
128-
%18 = call i8* @llvm.ptr.annotation.p0i8(i8* %17, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i32 0, i32 0), i32 27, i8* null), !dbg !99
131+
%18 = call i8* @llvm.ptr.annotation.p0i8(i8* %17, i8* bitcast ([25 x i8]* @.str.2 to i8*), i8* bitcast ([29 x i8]* @.str.1 to i8*), i32 27, i8* null), !dbg !99
129132
; -- No change of debug scope after the call in both cases with or without SPV_INTEL_fpga_reg extension.
130133
; CHECK-SPV-FPGA_REG-NEXT: {{[0-9]+}} FPGARegINTEL
131134
%19 = bitcast i8* %18 to %"struct._ZTSZZZ4mainENK3$_0clERN2cl4sycl7handlerEENKUlvE_clEvE3s_e.s_e"*, !dbg !99

0 commit comments

Comments
 (0)