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
7
1
8
2
isdense (:: Type{<:DenseArray} ) = true
9
3
@@ -443,19 +437,12 @@ function maybe_cse_load!(ls::LoopSet, expr::Expr, elementbytes::Int = 8)
443
437
@view (expr. args[2 + offset: end ]),
444
438
Ref (false )
445
439
):: ArrayReference
446
- # @show ref.ref
447
440
id = findfirst (r -> r == ref, ls. refs_aliasing_syms)
448
441
if id === nothing
449
442
add_load! ( ls, gensym (:temporary ), ref, elementbytes )
450
443
else
451
444
getop (ls, ls. syms_aliasing_refs[id], elementbytes)
452
445
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
459
446
end
460
447
function add_parent! (
461
448
parents:: Vector{Operation} , deps:: Vector{Symbol} , reduceddeps:: Vector{Symbol} , ls:: LoopSet , var, elementbytes:: Int = 8
518
505
function add_store! (
519
506
ls:: LoopSet , var:: Symbol , ref:: ArrayReference , elementbytes:: Int = 8
520
507
)
521
- # @show loopdependencies(ref)
522
- # @show ls.operations
523
508
ldref = loopdependencies (ref)
524
509
parent = getop (ls, var, ldref, elementbytes)
525
510
pvar = parent. variable
@@ -528,7 +513,6 @@ function add_store!(
528
513
push! (ls. refs_aliasing_syms, ref)
529
514
end
530
515
op = Operation ( length (operations (ls)), ref. array, elementbytes, :setindex! , memstore, ldref, reduceddependencies (parent), [parent], ref )
531
- # @show loopdependencies(op) op
532
516
add_vptr! (ls, ref. array, identifier (op), ref. ptr)
533
517
pushop! (ls, op, ref. array)
534
518
end
544
528
function add_operation! (
545
529
ls:: LoopSet , LHS:: Symbol , RHS:: Expr , elementbytes:: Int = 8
546
530
)
547
- # @show LHS, RHS
548
531
if RHS. head === :ref
549
532
add_load_ref! (ls, LHS, RHS, elementbytes)
550
533
elseif RHS. head === :call
565
548
function add_operation! (
566
549
ls:: LoopSet , LHS_sym:: Symbol , RHS:: Expr , LHS_ref:: ArrayReference , elementbytes:: Int = 8
567
550
)
568
- # @show LHS_sym, RHS
569
551
if RHS. head === :ref # || (RHS.head === :call && first(RHS.args) === :getindex)
570
552
add_load! (ls, LHS_sym, LHS_ref, elementbytes)
571
553
elseif RHS. head === :call
@@ -584,7 +566,6 @@ function add_operation!(
584
566
end
585
567
end
586
568
function Base. push! (ls:: LoopSet , ex:: Expr , elementbytes:: Int = 8 )
587
- # @show ex
588
569
if ex. head === :call
589
570
finex = first (ex. args):: Symbol
590
571
if finex === :setindex!
@@ -599,13 +580,11 @@ function Base.push!(ls::LoopSet, ex::Expr, elementbytes::Int = 8)
599
580
if RHS isa Expr
600
581
add_operation! (ls, LHS, RHS, elementbytes)
601
582
else
602
- # @show [keys(ls.loops)...]
603
583
add_constant! (ls, RHS, [keys (ls. loops)... ], LHS, elementbytes)
604
584
end
605
585
elseif LHS isa Expr
606
586
@assert LHS. head === :ref
607
587
local lrhs:: Symbol
608
- # @show LHS, RHS
609
588
if RHS isa Symbol
610
589
lrhs = RHS
611
590
elseif RHS isa Expr
637
616
function fillorder! (ls:: LoopSet , order:: Vector{Symbol} , loopistiled:: Bool )
638
617
lo = ls. loop_order
639
618
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
643
619
nloops = length (order)
644
620
if loopistiled
645
621
tiled = order[1 ]
0 commit comments