Skip to content

Commit 8296354

Browse files
authored
Merge pull request #154 from JuliaDiff/remove-loopinfo
remove :loopinfo from IR
2 parents 99cf2ee + 33c922d commit 8296354

File tree

4 files changed

+24
-20
lines changed

4 files changed

+24
-20
lines changed

Manifest.toml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ version = "0.4.4"
1111

1212
[[deps.Adapt]]
1313
deps = ["LinearAlgebra", "Requires"]
14-
git-tree-sha1 = "cc37d689f599e8df4f464b2fa3870ff7db7492ef"
14+
git-tree-sha1 = "76289dc51920fdc6e0013c872ba9551d54961c24"
1515
uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
16-
version = "3.6.1"
16+
version = "3.6.2"
1717
weakdeps = ["StaticArrays"]
1818

1919
[deps.Adapt.extensions]
@@ -33,9 +33,9 @@ version = "1.49.0"
3333

3434
[[deps.ChainRulesCore]]
3535
deps = ["Compat", "LinearAlgebra", "SparseArrays"]
36-
git-tree-sha1 = "c6d890a52d2c4d55d326439580c3b8d0875a77d9"
36+
git-tree-sha1 = "e30f2f4e20f7f186dc36529910beaedc60cfa644"
3737
uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
38-
version = "1.15.7"
38+
version = "1.16.0"
3939

4040
[[deps.CodeTracking]]
4141
deps = ["InteractiveUtils", "UUIDs"]
@@ -65,14 +65,14 @@ version = "1.0.2+0"
6565

6666
[[deps.Cthulhu]]
6767
deps = ["CodeTracking", "FoldingTrees", "InteractiveUtils", "JuliaSyntax", "PrecompileTools", "Preferences", "REPL", "TypedSyntax", "UUIDs", "Unicode", "WidthLimitedIO"]
68-
git-tree-sha1 = "4e396fa7a2f2570f02839e04be6af0744610dbc4"
68+
git-tree-sha1 = "aac06850ca054d0459ec212aed9788f60dbf79cf"
6969
uuid = "f68482b8-f384-11e8-15f7-abe071a5a75f"
70-
version = "2.8.14"
70+
version = "2.8.15"
7171

7272
[[deps.DataAPI]]
73-
git-tree-sha1 = "e8119c1a33d267e16108be441a287a6981ba1630"
73+
git-tree-sha1 = "8da84edb865b0b5b0100c0666a9bc9a0b71c553c"
7474
uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
75-
version = "1.14.0"
75+
version = "1.15.0"
7676

7777
[[deps.DataStructures]]
7878
deps = ["Compat", "InteractiveUtils", "OrderedCollections"]
@@ -107,9 +107,9 @@ version = "1.2.1"
107107

108108
[[deps.GPUArraysCore]]
109109
deps = ["Adapt"]
110-
git-tree-sha1 = "1cd7f0af1aa58abc02ea1d872953a97359cb87fa"
110+
git-tree-sha1 = "2d6ca471a6c7b536127afccfa7564b5b39227fe0"
111111
uuid = "46192b85-c4d5-4398-a991-12ede77f4527"
112-
version = "0.1.4"
112+
version = "0.1.5"
113113

114114
[[deps.InteractiveUtils]]
115115
deps = ["Markdown"]
@@ -126,9 +126,9 @@ uuid = "82899510-4779-5014-852e-03e436cf321d"
126126
version = "1.0.0"
127127

128128
[[deps.JuliaSyntax]]
129-
git-tree-sha1 = "e09bf943597f83cc7a1fe3ae6c01c2c008d8cde7"
129+
git-tree-sha1 = "3884259b6852ed89c7036c455551a556d8a3a124"
130130
uuid = "70703baa-626e-46a2-a12c-08ffd08c73b4"
131-
version = "0.3.5"
131+
version = "0.4.1"
132132

133133
[[deps.LibGit2]]
134134
deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
@@ -192,9 +192,9 @@ version = "1.6.0"
192192

193193
[[deps.PrecompileTools]]
194194
deps = ["Preferences"]
195-
git-tree-sha1 = "d0984cc886c48e5a165705ce65236dc2ec467b91"
195+
git-tree-sha1 = "259e206946c293698122f63e2b513a7c99a244e8"
196196
uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
197-
version = "1.1.0"
197+
version = "1.1.1"
198198

199199
[[deps.Preferences]]
200200
deps = ["TOML"]
@@ -249,9 +249,9 @@ version = "1.10.0"
249249

250250
[[deps.StaticArrays]]
251251
deps = ["LinearAlgebra", "Random", "StaticArraysCore", "Statistics"]
252-
git-tree-sha1 = "c262c8e978048c2b095be1672c9bee55b4619521"
252+
git-tree-sha1 = "8982b3607a212b070a5e46eea83eb62b4744ae12"
253253
uuid = "90137ffa-7385-5640-81b9-e52037218182"
254-
version = "1.5.24"
254+
version = "1.5.25"
255255

256256
[[deps.StaticArraysCore]]
257257
git-tree-sha1 = "6b7ba252635a5eff6a0b0664a41ee140a1c9e72a"
@@ -304,9 +304,9 @@ uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
304304

305305
[[deps.TypedSyntax]]
306306
deps = ["CodeTracking", "JuliaSyntax"]
307-
git-tree-sha1 = "fa9ca390d3b437f35c9ab33954fc0b294b011e09"
307+
git-tree-sha1 = "6da6670f978221bea4f501b600f34ec20cb9516e"
308308
uuid = "d265eb64-f81a-44ad-a842-4247ee1503de"
309-
version = "1.1.9"
309+
version = "1.1.10"
310310

311311
[[deps.UUIDs]]
312312
deps = ["Random", "SHA"]
@@ -324,4 +324,4 @@ version = "1.0.1"
324324
[[deps.libblastrampoline_jll]]
325325
deps = ["Artifacts", "Libdl"]
326326
uuid = "8e850b90-86db-534c-a0d3-1478176c7d93"
327-
version = "5.7.0+0"
327+
version = "5.8.0+0"

src/codegen/forward.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,12 @@ function fwd_transform!(ci, mi, nargs, N)
5353
return ZeroBundle{N}(mi.sparam_vals[stmt.args[1]::Int])
5454
elseif isexpr(stmt, :foreigncall)
5555
return Expr(:call, error, "Attempted to AD a foreigncall. Missing rule?")
56-
elseif isexpr(stmt, :meta) || isexpr(stmt, :inbounds)
56+
elseif isexpr(stmt, :meta) || isexpr(stmt, :inbounds) || isexpr(stmt, :loopinfo)
5757
# Can't trust that meta annotations are still valid in the AD'd
5858
# version.
5959
return nothing
6060
else
61+
#TODO put guard here. We really don't want invalid IR
6162
return Expr(:call, ZeroBundle{N}, stmt)
6263
end
6364
end

src/codegen/forward_demand.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ function forward_visit!(ir::IRCode, ssa::SSAValue, order::Int, ssa_orders::Vecto
185185
recurse(stmt)
186186
elseif isexpr(stmt, :code_coverage_effect)
187187
return
188+
elseif isexpr(stmt, :loopinfo) #TODO preserve this properly
189+
return
188190
elseif !isa(stmt, Expr)
189191
return
190192
else

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ let var"'" = Diffractor.PrimeDerivativeFwd
148148
@test sin''''''(1.0) == -sin(1.0)
149149
@test cos''''''(1.0) == -cos(1.0)
150150
@test exp''''''(1.0) == exp(1.0)
151+
@test (x->prod([x, 4]))'(3) == 4
151152
end
152153

153154
# Some Basic Mixed Mode tests

0 commit comments

Comments
 (0)