Skip to content

Commit 9cae206

Browse files
authored
Merge pull request #230 from JuliaDiff/kf/bcheckfollowup
Add forward mode transform for :boundscheck
2 parents e0ff39b + e3a1b8c commit 9cae206

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/codegen/forward_demand.jl

+5
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,11 @@ function forward_diff_no_inf!(ir::IRCode, to_diff::Vector{Pair{SSAValue,Int}};
314314
inst[:inst] = maparg(stmt, SSAValue(ssa), order)
315315
inst[:type] = Any
316316
inst[:flag] |= CC.IR_FLAG_REFINED
317+
elseif isexpr(stmt, :boundscheck)
318+
val = ZeroBundle{order}(stmt.args[1])
319+
inst[:inst] = val
320+
inst[:type] = Const(val)
321+
inst[:flag] |= CC.IR_FLAG_REFINED
317322
elseif isa(stmt, Expr) || isa(stmt, PhiNode) || isa(stmt, PhiCNode) ||
318323
isa(stmt, UpsilonNode) || isa(stmt, GotoIfNot) || isa(stmt, Argument)
319324
urs = userefs(stmt)

0 commit comments

Comments
 (0)