Skip to content

Commit 3a36c99

Browse files
authored
Verify LLVM IR on CI by default. (#375)
1 parent 7f2f49a commit 3a36c99

File tree

6 files changed

+20
-11
lines changed

6 files changed

+20
-11
lines changed

src/GPUCompiler.jl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ using ExprTools: splitdef, combinedef
99

1010
using Libdl
1111

12-
const to = TimerOutput()
13-
14-
timings() = (TimerOutputs.print_timer(to); println())
15-
16-
enable_timings() = (TimerOutputs.enable_debug_timings(GPUCompiler); return)
17-
1812
include("utils.jl")
1913

2014
# compiler interface and implementations

src/driver.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ const __llvm_initialized = Ref(false)
402402
end
403403
end
404404

405-
if ccall(:jl_is_debugbuild, Cint, ()) == 1
405+
if should_verify()
406406
@timeit_debug to "verification" verify(ir)
407407
end
408408
end

src/irgen.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ function add_kernel_state!(mod::LLVM.Module)
653653
end
654654
end
655655
end
656-
return nothing
656+
return nothing # do not claim responsibility
657657
end
658658
for (f, new_f) in workmap
659659
# use a value mapper for rewriting function arguments

src/utils.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@ defs(mod::LLVM.Module) = filter(f -> !isdeclaration(f), collect(functions(mod))
22
decls(mod::LLVM.Module) = filter(f -> isdeclaration(f) && !LLVM.isintrinsic(f),
33
collect(functions(mod)))
44

5+
## timings
6+
7+
const to = TimerOutput()
8+
9+
timings() = (TimerOutputs.print_timer(to); println())
10+
11+
enable_timings() = (TimerOutputs.enable_debug_timings(GPUCompiler); return)
12+
13+
14+
## debug verification
15+
16+
should_verify() = ccall(:jl_is_debugbuild, Cint, ()) == 1 ||
17+
Base.JLOptions().debug_level >= 2 ||
18+
parse(Bool, get(ENV, "CI", "false"))
19+
520

621
## lazy module loading
722

test/metal.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ end
8585

8686
############################################################################################
8787

88-
@testset "asm" begin
88+
Sys.isapple() && @testset "asm" begin
8989

9090
@testset "smoke test" begin
9191
kernel() = return

test/runtests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ GPUCompiler.enable_timings()
1919
include("native.jl")
2020
include("ptx.jl")
2121
include("spirv.jl")
22-
include("gcn.jl")
2322
include("bpf.jl")
24-
if Sys.isapple() && Base.thisminor(VERSION) == v"1.8"
23+
if VERSION >= v"1.8-"
24+
include("gcn.jl")
2525
include("metal.jl")
2626
end
2727
include("examples.jl")

0 commit comments

Comments
 (0)