Skip to content

Commit ed0c5c4

Browse files
committed
Initialiaze newparentop fields
1 parent 0acf4be commit ed0c5c4

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

src/codegen/lower_compute.jl

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -363,19 +363,19 @@ function getu₁forreduct(ls::LoopSet, op::Operation, u₁::Int)
363363
end
364364
isidentityop(op::Operation) = iscompute(op) && (instruction(op).instr === :identity) && (length(parents(op)) == 1)
365365
function reduce_parent!(q::Expr, ls::LoopSet, op::Operation, opp::Operation, parent::Symbol)
366-
isvectorized(op) && return parent
367-
dependent_outer_reducts(ls, op) && return parent
368-
if isvectorized(opp)
369-
oppt = opp
370-
elseif isidentityop(opp)
371-
oppt = only(parents(opp))
372-
isvectorized(oppt) || return parent
373-
else
374-
return parent
375-
end
376-
newp = gensym(parent)
377-
push!(q.args, Expr(:(=), newp, Expr(:call, lv(reduction_to_scalar(oppt.instruction)), parent)))
378-
newp
366+
isvectorized(op) && return parent
367+
dependent_outer_reducts(ls, op) && return parent
368+
if isvectorized(opp)
369+
oppt = opp
370+
elseif isidentityop(opp)
371+
oppt = only(parents(opp))
372+
isvectorized(oppt) || return parent
373+
else
374+
return parent
375+
end
376+
newp = gensym(parent)
377+
push!(q.args, Expr(:(=), newp, Expr(:call, lv(reduction_to_scalar(oppt.instruction)), parent)))
378+
newp
379379
end
380380
function lower_compute!(
381381
q::Expr, op::Operation, ls::LoopSet, ua::UnrollArgs, mask::Bool
@@ -410,6 +410,9 @@ function lower_compute!(
410410
parentop.identifier, gensym(parentop.variable), parentop.elementbytes, parentop.instruction, parentop.node_type,
411411
parentop.dependencies, parentop.reduced_deps, parentop.parents, parentop.ref, parentop.reduced_children
412412
)
413+
newparentop.vectorized = false
414+
newparentop.u₁unrolled = false
415+
newparentop.u₂unrolled = parents_u₂syms[i]
413416
parentname = mangledvar(parentop)
414417
newparentname = mangledvar(newparentop)
415418
parents_op[i] = newparentop

0 commit comments

Comments
 (0)