diff --git a/.github/workflows/Testing.yaml b/.github/workflows/Testing.yaml index a54a7c83..48d03b62 100644 --- a/.github/workflows/Testing.yaml +++ b/.github/workflows/Testing.yaml @@ -42,5 +42,3 @@ jobs: ${{ runner.os }}- - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest - with: - coverage: false diff --git a/Project.toml b/Project.toml index 0ff54cc7..e479cdc4 100644 --- a/Project.toml +++ b/Project.toml @@ -3,10 +3,9 @@ uuid = "6f1fad26-d15e-5dc8-ae53-837a1d7b8c9f" license = "MIT" desc = "Tape based task copying in Turing" repo = "https://github.com/TuringLang/Libtask.jl.git" -version = "0.7.2" +version = "0.7.3" [deps] -CodeInfoTools = "bc773b8a-8374-437a-b9f2-0e9785855863" FunctionWrappers = "069b7b12-0de2-55c6-9aab-29f3d0a68a2e" LRUCache = "8ac3fa9e-de4c-5943-b1dc-09c6b5f20637" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" @@ -14,7 +13,6 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" [compat] FunctionWrappers = "1.1" -CodeInfoTools = "0.3.4" LRUCache = "1.3" julia = "1.7" diff --git a/src/Libtask.jl b/src/Libtask.jl index bea169d0..92275966 100644 --- a/src/Libtask.jl +++ b/src/Libtask.jl @@ -1,6 +1,5 @@ module Libtask -using CodeInfoTools using FunctionWrappers: FunctionWrapper using LRUCache diff --git a/src/tapedfunction.jl b/src/tapedfunction.jl index 2a7ac122..bef330e8 100644 --- a/src/tapedfunction.jl +++ b/src/tapedfunction.jl @@ -3,6 +3,14 @@ abstract type AbstractInstruction end const RawTape = Vector{AbstractInstruction} +function _infer(f, args_type) + # `code_typed` returns a vector: [Pair{Core.CodeInfo, DataType}] + ir0 = code_typed(f, Tuple{args_type...}, optimize=false)[1][1] + # ir1 = CodeInfoTools.code_inferred(f, args_type...) + # ir1.ssavaluetypes = ir0.ssavaluetypes + return ir0 +end + mutable struct TapedFunction{F, TapeType} func::F # maybe a function, a constructor, or a callable object arity::Int @@ -22,8 +30,7 @@ mutable struct TapedFunction{F, TapeType} tf.counter = 1 return tf end - - ir = CodeInfoTools.code_inferred(f, args_type...) + ir = _infer(f, args_type) bindings, tape = translate!(RawTape(), ir) tf = new{F, T}(f, length(args), ir, tape, 1, bindings, :none)