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
3
3
; RUN: llvm-spirv %t.spv --to-text -o %t.spt
4
4
; RUN: FileCheck < %t.spt %s --check-prefixes=CHECK,CHECK-SPV
5
5
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
7
7
; RUN: llvm-spirv %t.fpga_reg.spv --to-text -o %t.fpga_reg.spt
8
8
; RUN: FileCheck < %t.fpga_reg.spt %s --check-prefixes=CHECK,CHECK-SPV-FPGA_REG
9
9
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
+
10
14
; -- 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
13
17
14
18
; ModuleID = 'annotation_dbg_info_drop.cpp'
15
19
source_filename = "annotation_dbg_info_drop.cpp"
@@ -60,10 +64,9 @@ entry:
60
64
call void @llvm.lifetime.start.p0i8 (i64 1 , i8* %0 ) #5 , !dbg !72
61
65
call void @llvm.dbg.declare (metadata [1 x i8 ]* %Buf , metadata !52 , metadata !DIExpression ()), !dbg !73
62
66
%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
64
68
; 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
67
70
call spir_func void @_Z1fv (), !dbg !74
68
71
; -- var.annotation call is dropped. Restore debug scope after the call.
69
72
; CHECK-NEXT: {{[0-9]+}} ExtInst {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} DebugScope
77
80
call void @llvm.lifetime.start.p0i8 (i64 4 , i8* %2 ) #5 , !dbg !79
78
81
call void @llvm.dbg.declare (metadata i32* %b , metadata !54 , metadata !DIExpression ()), !dbg !80
79
82
%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
81
84
; 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]]
83
86
store i32 %4 , i32* %b , align 4 , !dbg !80 , !tbaa !77
84
87
; -- Restore debug scope after the call in both cases with or without SPV_INTEL_fpga_reg extension.
85
88
; CHECK-NEXT: {{[0-9]+}} ExtInst {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} DebugScope
95
98
; -- annotation call is dropped. No debug scope or line change for first argument declaration.
96
99
; CHECK-NEXT: {{[0-9]+}} Load
97
100
; 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
99
102
; CHECK-SPV-FPGA_REG-NEXT: {{[0-9]+}} FPGARegINTEL
100
103
store i64 %8 , i64* %c , align 8 , !dbg !84 , !tbaa !39
101
104
; CHECK-SPV-NEXT: {{[0-9]+}} Store
@@ -104,9 +107,9 @@ entry:
104
107
call void @llvm.dbg.declare (metadata %"struct._ZTSZZZ4mainENK3$_0clERN2cl4sycl7handlerEENKUlvE_clEvE3s_d.s_d" * %d , metadata !56 , metadata !DIExpression ()), !dbg !88
105
108
%mem = getelementptr inbounds %"struct._ZTSZZZ4mainENK3$_0clERN2cl4sycl7handlerEENKUlvE_clEvE3s_d.s_d" , %"struct._ZTSZZZ4mainENK3$_0clERN2cl4sycl7handlerEENKUlvE_clEvE3s_d.s_d" * %d , i32 0 , i32 0 , !dbg !89
106
109
%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
108
111
; 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]]
110
113
%12 = bitcast i8* %11 to [8 x i32 ]*, !dbg !89
111
114
; -- annotation call is dropped. Restore debug scope
112
115
; CHECK-NEXT: {{[0-9]+}} ExtInst {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} DebugScope
@@ -125,7 +128,7 @@ entry:
125
128
call void @llvm.memcpy.p0i8.p0i8.i64 (i8* align 4 %15 , i8* align 4 %16 , i64 16 , i1 false ), !dbg !96 , !tbaa.struct !97
126
129
%17 = bitcast %"struct._ZTSZZZ4mainENK3$_0clERN2cl4sycl7handlerEENKUlvE_clEvE3s_e.s_e" * %agg-temp to i8* , !dbg !99
127
130
; 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
129
132
; -- No change of debug scope after the call in both cases with or without SPV_INTEL_fpga_reg extension.
130
133
; CHECK-SPV-FPGA_REG-NEXT: {{[0-9]+}} FPGARegINTEL
131
134
%19 = bitcast i8* %18 to %"struct._ZTSZZZ4mainENK3$_0clERN2cl4sycl7handlerEENKUlvE_clEvE3s_e.s_e" *, !dbg !99
0 commit comments