Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel state rewrite messes up debug info #374

Closed
vchuravy opened this issue Nov 21, 2022 · 0 comments · Fixed by #376
Closed

Kernel state rewrite messes up debug info #374

vchuravy opened this issue Nov 21, 2022 · 0 comments · Fixed by #376

Comments

@vchuravy
Copy link
Member

I believe I have bisected EnzymeAD/Enzyme.jl#533 to an issue with the kernelstate lowering.

I inserted a call to verify after and before

@dispose pm=ModulePassManager() begin

My hypothesis is that we do replace_metadata_uses! but that maybe doesn't handle the debuginfo?

ERROR: LoadError: LLVM error: mismatched subprogram between llvm.dbg.declare variable and !dbg attachment
  call void @llvm.dbg.declare(metadata { i8 addrspace(1)*, i64, [1 x i64], i64 }* undef, metadata !173, metadata !DIExpression(DW_OP_deref)), !dbg !178
label %conversion
void ([1 x i64], { i8 addrspace(1)*, i64, [1 x i64], i64 }, { i8 addrspace(1)*, i64, [1 x i64], i64 })* @_Z23julia_grad_kernel__291613CuDeviceArrayI7Float32Li1ELi1EES_IS0_Li1ELi1EE
!173 = !DILocalVariable(name: "a", arg: 2, scope: !174, file: !4, line: 10, type: !86)
!174 = distinct !DISubprogram(name: "grad_kernel!", linkageName: "julia_grad_kernel!_2916", scope: null, file: !4, line: 10, type: !166, scopeLine: 10, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !3, retainedNodes: !175)
!178 = !DILocation(line: 10, scope: !165)
!165 = distinct !DISubprogram(name: "grad_kernel!", linkageName: "julia_grad_kernel!_2916", scope: null, file: !4, line: 10, type: !166, scopeLine: 10, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !3, retainedNodes: !169)
mismatched subprogram between llvm.dbg.declare variable and !dbg attachment
  call void @llvm.dbg.declare(metadata { i8 addrspace(1)*, i64, [1 x i64], i64 }* undef, metadata !177, metadata !DIExpression(DW_OP_deref)), !dbg !178
label %conversion
void ([1 x i64], { i8 addrspace(1)*, i64, [1 x i64], i64 }, { i8 addrspace(1)*, i64, [1 x i64], i64 })* @_Z23julia_grad_kernel__291613CuDeviceArrayI7Float32Li1ELi1EES_IS0_Li1ELi1EE
!177 = !DILocalVariable(name: "da", arg: 3, scope: !174, file: !4, line: 10, type: !86)
!174 = distinct !DISubprogram(name: "grad_kernel!", linkageName: "julia_grad_kernel!_2916", scope: null, file: !4, line: 10, type: !166, scopeLine: 10, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !3, retainedNodes: !175)
!178 = !DILocation(line: 10, scope: !165)
!165 = distinct !DISubprogram(name: "grad_kernel!", linkageName: "julia_grad_kernel!_2916", scope: null, file: !4, line: 10, type: !166, scopeLine: 10, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !3, retainedNodes: !169)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant