1- # lv(x) = Expr(:(.), :LoopVectorization, QuoteNode(x))
2- # @static if VERSION < v"1.3.0"
3- # lv(x) = Expr(:(.), :LoopVectorization, QuoteNode(x))
4- # else
5-
6- # end
71
82isdense (:: Type{<:DenseArray} ) = true
93
@@ -443,19 +437,12 @@ function maybe_cse_load!(ls::LoopSet, expr::Expr, elementbytes::Int = 8)
443437 @view (expr. args[2 + offset: end ]),
444438 Ref (false )
445439 ):: ArrayReference
446- # @show ref.ref
447440 id = findfirst (r -> r == ref, ls. refs_aliasing_syms)
448441 if id === nothing
449442 add_load! ( ls, gensym (:temporary ), ref, elementbytes )
450443 else
451444 getop (ls, ls. syms_aliasing_refs[id], elementbytes)
452445 end
453- # id = includesarray(ls, array)
454- # if id > 0
455- # ls.operations[id]
456- # else
457- # add_load!( ls, gensym(:temporary), array, args, elementbytes )
458- # end
459446end
460447function add_parent! (
461448 parents:: Vector{Operation} , deps:: Vector{Symbol} , reduceddeps:: Vector{Symbol} , ls:: LoopSet , var, elementbytes:: Int = 8
518505function add_store! (
519506 ls:: LoopSet , var:: Symbol , ref:: ArrayReference , elementbytes:: Int = 8
520507)
521- # @show loopdependencies(ref)
522- # @show ls.operations
523508 ldref = loopdependencies (ref)
524509 parent = getop (ls, var, ldref, elementbytes)
525510 pvar = parent. variable
@@ -528,7 +513,6 @@ function add_store!(
528513 push! (ls. refs_aliasing_syms, ref)
529514 end
530515 op = Operation ( length (operations (ls)), ref. array, elementbytes, :setindex! , memstore, ldref, reduceddependencies (parent), [parent], ref )
531- # @show loopdependencies(op) op
532516 add_vptr! (ls, ref. array, identifier (op), ref. ptr)
533517 pushop! (ls, op, ref. array)
534518end
544528function add_operation! (
545529 ls:: LoopSet , LHS:: Symbol , RHS:: Expr , elementbytes:: Int = 8
546530)
547- # @show LHS, RHS
548531 if RHS. head === :ref
549532 add_load_ref! (ls, LHS, RHS, elementbytes)
550533 elseif RHS. head === :call
565548function add_operation! (
566549 ls:: LoopSet , LHS_sym:: Symbol , RHS:: Expr , LHS_ref:: ArrayReference , elementbytes:: Int = 8
567550)
568- # @show LHS_sym, RHS
569551 if RHS. head === :ref # || (RHS.head === :call && first(RHS.args) === :getindex)
570552 add_load! (ls, LHS_sym, LHS_ref, elementbytes)
571553 elseif RHS. head === :call
@@ -584,7 +566,6 @@ function add_operation!(
584566 end
585567end
586568function Base. push! (ls:: LoopSet , ex:: Expr , elementbytes:: Int = 8 )
587- # @show ex
588569 if ex. head === :call
589570 finex = first (ex. args):: Symbol
590571 if finex === :setindex!
@@ -599,13 +580,11 @@ function Base.push!(ls::LoopSet, ex::Expr, elementbytes::Int = 8)
599580 if RHS isa Expr
600581 add_operation! (ls, LHS, RHS, elementbytes)
601582 else
602- # @show [keys(ls.loops)...]
603583 add_constant! (ls, RHS, [keys (ls. loops)... ], LHS, elementbytes)
604584 end
605585 elseif LHS isa Expr
606586 @assert LHS. head === :ref
607587 local lrhs:: Symbol
608- # @show LHS, RHS
609588 if RHS isa Symbol
610589 lrhs = RHS
611590 elseif RHS isa Expr
637616function fillorder! (ls:: LoopSet , order:: Vector{Symbol} , loopistiled:: Bool )
638617 lo = ls. loop_order
639618 ro = lo. loopnames # reverse order; will have same order as lo
640- # @show 1, ro, order
641- # copyto!(ro, order)
642- # @show 2, ro, order
643619 nloops = length (order)
644620 if loopistiled
645621 tiled = order[1 ]
0 commit comments