@@ -22,8 +22,8 @@ function UnrollArgs(ua::UnrollArgs, u::Int)
2222end
2323# UnrollSymbols(ua::UnrollArgs) = UnrollSymbols(ua.u₁loopsym, ua.u₂loopsym, ua.vectorized)
2424
25- isfirst (ua:: UnrollArgs{Nothing} ) = iszero (ua. u₁)
26- isfirst (ua:: UnrollArgs{Int} ) = iszero (ua. u₁) & iszero (ua. suffix)
25+ # isfirst(ua::UnrollArgs{Nothing}) = iszero(ua.u₁)
26+ # isfirst(ua::UnrollArgs{Int}) = iszero(ua.u₁) & iszero(ua.suffix)
2727
2828struct UnrollSpecification
2929 u₁loopnum:: Int
@@ -191,12 +191,12 @@ struct LoopOrder <: AbstractArray{Vector{Operation},5}
191191 loopnames:: Vector{Symbol}
192192 bestorder:: Vector{Symbol}
193193end
194- function LoopOrder (N:: Int )
195- LoopOrder (
196- [ Operation[] for _ ∈ 1 : 8 N ],
197- Vector {Symbol} (undef, N), Vector {Symbol} (undef, N)
198- )
199- end
194+ # function LoopOrder(N::Int)
195+ # LoopOrder(
196+ # [ Operation[] for _ ∈ 1:8N ],
197+ # Vector{Symbol}(undef, N), Vector{Symbol}(undef, N)
198+ # )
199+ # end
200200LoopOrder () = LoopOrder (Vector{Operation}[],Symbol[],Symbol[])
201201Base. empty! (lo:: LoopOrder ) = foreach (empty!, lo. oporder)
202202function Base. resize! (lo:: LoopOrder , N:: Int )
@@ -300,18 +300,18 @@ function pushpreamble!(ls::LoopSet, op::Operation, v::Number)
300300 end
301301end
302302pushpreamble! (ls:: LoopSet , ex:: Expr ) = push! (ls. preamble. args, ex)
303- function pushpreamble! (ls:: LoopSet , op:: Operation , RHS:: Expr )
304- c = gensym (:licmconst )
305- if RHS. head === :call && first (RHS. args) === :zero
306- push! (ls. preamble_zeros, (identifier (op), IntOrFloat))
307- elseif RHS. head === :call && first (RHS. args) === :one
308- push! (ls. preamble_funcofeltypes, (identifier (op), :one ))
309- else
310- pushpreamble! (ls, Expr (:(= ), c, RHS))
311- pushpreamble! (ls, op, c)
312- end
313- nothing
314- end
303+ # function pushpreamble!(ls::LoopSet, op::Operation, RHS::Expr)
304+ # c = gensym(:licmconst)
305+ # if RHS.head === :call && first(RHS.args) === :zero
306+ # push!(ls.preamble_zeros, (identifier(op), IntOrFloat))
307+ # elseif RHS.head === :call && first(RHS.args) === :one
308+ # push!(ls.preamble_funcofeltypes, (identifier(op), :one))
309+ # else
310+ # pushpreamble!(ls, Expr(:(=), c, RHS))
311+ # pushpreamble!(ls, op, c)
312+ # end
313+ # nothing
314+ # end
315315function zerotype (ls:: LoopSet , op:: Operation )
316316 opid = identifier (op)
317317 for (id,typ) ∈ ls. preamble_zeros
@@ -363,9 +363,9 @@ getloop(ls::LoopSet, s::Symbol) = ls.loops[getloopid(ls, s)]
363363getloopsym (ls:: LoopSet , i:: Integer ) = ls. loopsymbols[i]
364364Base. length (ls:: LoopSet , s:: Symbol ) = length (getloop (ls, s))
365365
366- isstaticloop (ls:: LoopSet , s:: Symbol ) = isstaticloop (getloop (ls,s))
367- looprangehint (ls:: LoopSet , s:: Symbol ) = length (getloop (ls, s))
368- looprangesym (ls:: LoopSet , s:: Symbol ) = getloop (ls, s). rangesym
366+ # isstaticloop(ls::LoopSet, s::Symbol) = isstaticloop(getloop(ls,s))
367+ # looprangehint(ls::LoopSet, s::Symbol) = length(getloop(ls, s))
368+ # looprangesym(ls::LoopSet, s::Symbol) = getloop(ls, s).rangesym
369369getop (ls:: LoopSet , var:: Number , elementbytes) = add_constant! (ls, var, elementbytes)
370370function getop (ls:: LoopSet , var:: Symbol , elementbytes:: Int )
371371 get! (ls. opdict, var) do
@@ -546,14 +546,13 @@ function maybe_const_compute!(ls::LoopSet, op::Operation, elementbytes::Int, pos
546546 end
547547end
548548function strip_op_linenumber_nodes (q:: Expr )
549- non_lnn_ind = 0
550- for i ∈ eachindex (q . args)
551- if ! (q . args[i] isa LineNumberNode )
552- @assert iszero (non_lnn_ind) " There should only be one non-LineNumberNode in the expression. "
553- non_lnn_ind = i
554- end
549+ filtered = filter (x -> ! isa (x, LineNumberNode), q . args)
550+ if VERSION ≥ v " 1.4 "
551+ only (filtered )
552+ else
553+ @assert isone ( length (filtered))
554+ first (filtered)
555555 end
556- q. args[non_lnn_ind]
557556end
558557
559558function add_operation! (
0 commit comments