@@ -115,12 +115,11 @@ end
115
115
116
116
function add_reduction_update_parent! (
117
117
vparents:: Vector{Operation} , deps:: Vector{Symbol} , reduceddeps:: Vector{Symbol} , ls:: LoopSet ,
118
- parent:: Operation , instr:: Symbol , reduction_ind:: Int , elementbytes:: Int
118
+ parent:: Operation , instr:: Instruction , reduction_ind:: Int , elementbytes:: Int
119
119
)
120
120
var = name (parent)
121
121
isouterreduction = parent. instruction === LOOPCONSTANT
122
- Instr = instruction (ls, instr)
123
- instrclass = reduction_instruction_class (Instr) # key allows for faster lookups
122
+ instrclass = reduction_instruction_class (instr) # key allows for faster lookups
124
123
reduct_zero = reduction_zero (instrclass)
125
124
# if parent is not an outer reduction...
126
125
# if !isouterreduction && !isreductzero(parent, ls, reduct_zero)
@@ -155,7 +154,7 @@ function add_reduction_update_parent!(
155
154
# directdependency && pushparent!(vparents, deps, reduceddeps, reductinit)#parent) # deps and reduced deps will not be disjoint
156
155
if reduction_ind > 0 # if is directdependency
157
156
insert! (vparents, reduction_ind, reductinit)
158
- if instr ∈ (:- , :vsub! , :vsub , :/ , :vfdiv! , :vfidiv! )
157
+ if instr. instr ∈ (:- , :vsub! , :vsub , :/ , :vfdiv! , :vfidiv! )
159
158
update_deps! (deps, reduceddeps, reductinit)# parent) # deps and reduced deps will not be disjoint
160
159
end
161
160
# elseif !isouterreduction
@@ -188,9 +187,9 @@ function add_compute!(
188
187
)
189
188
@assert ex. head === :call
190
189
# instr = instruction(first(ex.args))::Symbol
191
- instr = instruction! (ls, first (ex. args)):: Symbol
190
+ instr = instruction! (ls, first (ex. args)):: Instruction
192
191
args = @view (ex. args[2 : end ])
193
- (instr === :(^ ) && length (args) == 2 && (args[2 ] isa Number)) && return add_pow! (ls, var, args[1 ], args[2 ], elementbytes, position)
192
+ (instr. instr === :(^ ) && length (args) == 2 && (args[2 ] isa Number)) && return add_pow! (ls, var, args[1 ], args[2 ], elementbytes, position)
194
193
vparents = Operation[]
195
194
deps = Symbol[]
196
195
reduceddeps = Symbol[]
@@ -241,13 +240,13 @@ function add_compute!(
241
240
if length (reduceddeps) == 0
242
241
insert! (vparents, reduction_ind, parent)
243
242
mergesetv! (deps, loopdependencies (parent))
244
- op = Operation (length (operations (ls)), var, elementbytes, instruction (ls, instr) , compute, deps, reduceddeps, vparents)
243
+ op = Operation (length (operations (ls)), var, elementbytes, instr, compute, deps, reduceddeps, vparents)
245
244
pushop! (ls, op, var)
246
245
else
247
246
add_reduction_update_parent! (vparents, deps, reduceddeps, ls, parent, instr, reduction_ind, elementbytes)
248
247
end
249
248
else
250
- op = Operation (length (operations (ls)), var, elementbytes, instruction (ls, instr) , compute, deps, reduceddeps, vparents)
249
+ op = Operation (length (operations (ls)), var, elementbytes, instr, compute, deps, reduceddeps, vparents)
251
250
pushop! (ls, op, var)
252
251
end
253
252
end
0 commit comments