Skip to content
This repository was archived by the owner on May 27, 2021. It is now read-only.

Commit 8e0de55

Browse files
authored
Merge pull request #522 from JuliaGPU/tb/nightly_di
Fixes for Julia 1.4: disable DI on LLVM 8.0.
2 parents c3da969 + d7fce7d commit 8e0de55

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/CUDAnative.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ function __init__()
8383
error("LLVM $llvm_version incompatible with Julia's LLVM $julia_llvm_version")
8484
end
8585

86+
if v"8.0" <= llvm_version < v"9.0"
87+
# NOTE: corresponding functionality in irgen.jl
88+
silent || @warn "LLVM pre-9.0 detected, disabling debug info emission for CUDA kernels"
89+
end
90+
8691

8792
# CUDA
8893

src/compiler/irgen.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,14 @@ function compile_method_instance(job::CompilerJob, method_instance::Core.MethodI
137137
debug_info_kind = if Base.JLOptions().debug_level == 0
138138
LLVM.API.LLVMDebugEmissionKindNoDebug
139139
elseif Base.JLOptions().debug_level == 1
140-
LLVM.API.LLVMDebugEmissionKindDebugDirectivesOnly
140+
LLVM.API.LLVMDebugEmissionKindLineTablesOnly
141141
elseif Base.JLOptions().debug_level >= 2
142142
LLVM.API.LLVMDebugEmissionKindFullDebug
143143
end
144+
if LLVM.version() < v"9.0"
145+
# NOTE: corresponding warning in __init__
146+
debug_info_kind = LLVM.API.LLVMDebugEmissionKindNoDebug
147+
end
144148
push!(param_kwargs, :debug_info_kind => Cint(debug_info_kind))
145149
end
146150
params = Base.CodegenParams(;param_kwargs...)

test/codegen.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ end
3333
# plain exceptions should get lowered to a call to the CUDAnative run-time
3434
@test occursin("ptx_report_exception", ir)
3535
# not a jl_throw referencing a jl_value_t representing the exception
36-
@test !occursin("jl_value_t", ir)
3736
@test !occursin("jl_throw", ir)
3837
end
3938

0 commit comments

Comments
 (0)