Skip to content

Commit a076a62

Browse files
authored
Fixup with current versions (#120)
* add more escaping slashes to docstring * update llvmtype -> value_type * properly splat kwargs * test 1.9.0-rc3 in the integration tests * remove 1.9.0 from the nightly integration tests * fix for julia master * remove some --compile=min * [noci] bump version
1 parent c3f7340 commit a076a62

7 files changed

Lines changed: 18 additions & 13 deletions

File tree

.github/workflows/ci-integration-nightly.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ jobs:
1919
matrix:
2020
version:
2121
- 'nightly'
22-
- '~1.9.0-0'
2322
os:
2423
- ubuntu-latest
2524
- macOS-latest

.github/workflows/ci-integration.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
version:
21+
- '1.9.0-rc3'
2122
- '1.8'
2223
os:
2324
- ubuntu-latest

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "StaticCompiler"
22
uuid = "81625895-6c0f-48fc-b932-11a18313743c"
33
authors = ["Tom Short and contributors"]
4-
version = "0.4.10"
4+
version = "0.4.11"
55

66
[deps]
77
Clang_jll = "0ee61d77-7f21-5576-8119-9fcc46b10100"

src/StaticCompiler.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ julia> using StaticCompiler
211211
212212
julia> function puts(s::Ptr{UInt8}) # Can't use Base.println because it allocates.
213213
# Note, this `llvmcall` requires Julia 1.8+
214-
Base.llvmcall((\"""
214+
Base.llvmcall((\"\"\"
215215
; External declaration of the puts function
216216
declare i32 @puts(i8* nocapture) nounwind
217217
@@ -220,7 +220,7 @@ julia> function puts(s::Ptr{UInt8}) # Can't use Base.println because it allocate
220220
%call = call i32 (i8*) @puts(i8* %0)
221221
ret i32 0
222222
}
223-
\""", "main"), Int32, Tuple{Ptr{UInt8}}, s)
223+
\"\"\", "main"), Int32, Tuple{Ptr{UInt8}}, s)
224224
end
225225
puts (generic function with 1 method)
226226
@@ -619,11 +619,11 @@ end
619619
#Return an LLVM module for multiple functions
620620
function native_llvm_module(funcs::Array; demangle = false, kwargs...)
621621
f,tt = funcs[1]
622-
mod = native_llvm_module(f,tt, kwargs...)
622+
mod = native_llvm_module(f,tt; kwargs...)
623623
if length(funcs) > 1
624624
for func in funcs[2:end]
625625
f,tt = func
626-
tmod = native_llvm_module(f,tt, kwargs...)
626+
tmod = native_llvm_module(f,tt; kwargs...)
627627
link!(mod,tmod)
628628
end
629629
end

src/interpreter.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## interpreter
22

33
using Core.Compiler:
4-
AbstractInterpreter, InferenceResult, InferenceParams, InferenceState, MethodInstance, OptimizationParams, WorldView
4+
AbstractInterpreter, InferenceResult, InferenceParams, InferenceState, MethodInstance, OptimizationParams, WorldView, get_world_counter
55
using GPUCompiler:
66
@safe_debug, AbstractCompilerParams, CodeCache, CompilerJob, methodinstance
77
using CodeInfoTools
@@ -85,8 +85,13 @@ function custom_pass!(interp::StaticInterpreter, result::InferenceResult, mi::Co
8585
return src
8686
end
8787

88-
function InferenceState(result::InferenceResult, cache::Symbol, interp::StaticInterpreter)
89-
src = Core.Compiler.retrieve_code_info(result.linfo)
88+
function Core.Compiler.InferenceState(result::InferenceResult, cache::Symbol, interp::StaticInterpreter)
89+
world = get_world_counter(interp)
90+
src = @static if VERSION >= v"1.10.0-DEV.873"
91+
Core.Compiler.retrieve_code_info(result.linfo, world)
92+
else
93+
Core.Compiler.retrieve_code_info(result.linfo)
94+
end
9095
mi = result.linfo
9196
src = custom_pass!(interp, result, mi, src)
9297
src === nothing && return nothing

src/pointer_patching.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function get_pointers!(d, mod, inst)
138138
LLVM.API.LLVMSetOperand(inst, i-1, gv)
139139
else
140140
gv_name = fix_name(String(gensym(repr(Core.Typeof(val)))))
141-
gv = LLVM.GlobalVariable(mod, llvmeltype(arg), gv_name, LLVM.addrspace(llvmtype(arg)))
141+
gv = LLVM.GlobalVariable(mod, llvmeltype(arg), gv_name, LLVM.addrspace(value_type(arg)))
142142

143143
LLVM.extinit!(gv, true)
144144
LLVM.API.LLVMSetOperand(inst, i-1, gv)
@@ -153,7 +153,7 @@ function get_pointers!(d, mod, inst)
153153
end
154154
end
155155

156-
llvmeltype(x::LLVM.Value) = eltype(LLVM.llvmtype(x))
156+
llvmeltype(x::LLVM.Value) = eltype(LLVM.value_type(x))
157157

158158
function pointer_patching_diff(f, tt, path1=tempname(), path2=tempname(); show_reloc_table=false)
159159
tm = GPUCompiler.llvm_machine(NativeCompilerTarget())

test/testintegration.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
status = -1
160160
try
161161
isfile("loopvec_matrix") && rm("loopvec_matrix")
162-
status = run(`$jlpath --startup=no --compile=min $testpath/scripts/loopvec_matrix.jl`)
162+
status = run(`$jlpath --startup=no $testpath/scripts/loopvec_matrix.jl`)
163163
catch e
164164
@warn "Could not compile $testpath/scripts/loopvec_matrix.jl"
165165
println(e)
@@ -190,7 +190,7 @@
190190
status = -1
191191
try
192192
isfile("loopvec_matrix_stack") && rm("loopvec_matrix_stack")
193-
status = run(`$jlpath --startup=no --compile=min $testpath/scripts/loopvec_matrix_stack.jl`)
193+
status = run(`$jlpath --startup=no $testpath/scripts/loopvec_matrix_stack.jl`)
194194
catch e
195195
@warn "Could not compile $testpath/scripts/loopvec_matrix_stack.jl"
196196
println(e)

0 commit comments

Comments
 (0)