Skip to content

Commit 5373279

Browse files
authored
Correct treatment of QuoteNode in stmt position (#140)
Similar to #138. QuoteNode's value does actually need to be wrapped in ZeroBundle, otherwise it'll be at the wrong diff level.
1 parent 3751c0f commit 5373279

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/codegen/forward_demand.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,11 @@ function forward_diff_no_inf!(ir::IRCode, to_diff::Vector{Pair{SSAValue, Int}};
268268
# TODO: New PiNode that discriminates based on primal?
269269
inst[:inst] = maparg(stmt.val, SSAValue(ssa), order)
270270
inst[:type] = Any
271-
elseif isa(stmt, GlobalRef) || isa(stmt, SSAValue)
271+
elseif isa(stmt, GlobalRef) || isa(stmt, SSAValue) || isa(stmt, QuoteNode)
272272
inst[:inst] = maparg(stmt, SSAValue(ssa), order)
273273
inst[:type] = Any
274274
elseif isa(stmt, Expr) || isa(stmt, PhiNode) || isa(stmt, PhiCNode) ||
275-
isa(stmt, UpsilonNode) || isa(stmt, GotoIfNot) || isa(stmt, QuoteNode) || isa(stmt, Argument)
275+
isa(stmt, UpsilonNode) || isa(stmt, GotoIfNot) || isa(stmt, Argument)
276276
urs = userefs(stmt)
277277
for ur in urs
278278
ur[] = maparg(ur[], SSAValue(ssa), order)

0 commit comments

Comments
 (0)