Skip to content

Commit e62a7d6

Browse files
authored
WIP: Faster Inference (#357)
We need to check if this regresses quality somewhere, but if not, this should speed up inference of LoopVectorization a fair bit.
1 parent 134a95c commit e62a7d6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/codegen/lower_memory_common.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function symbolind(ind::Symbol, op::Operation, td::UnrollArgs, ls::LoopSet)
1313
Symbol(pvar, '_', Core.ifelse(u₁op, u₁, 1)), parent
1414
end
1515

16-
staticexpr(x::Int) = Expr(:call, Expr(:curly, lv(:StaticInt), x))
16+
staticexpr(x::Int) = StaticInt{x}()
1717
staticexpr(x::Union{Symbol,Expr}) = Expr(:call, lv(:StaticInt), x)
1818

1919
_MMind(ind::Union{Symbol,Expr}, str::Int) = Expr(:call, lv(:MM), VECTORWIDTHSYMBOL, ind, staticexpr(str))

src/codegen/lowering.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ end
474474
S
475475
end
476476
end
477-
function outer_reduction_zero(op::Operation, u₁u::Bool, Umax::Int, reduct_class::Float64, rs::Expr)
477+
function outer_reduction_zero(op::Operation, u₁u::Bool, Umax::Int, reduct_class::Float64, rs::Union{Expr, StaticInt})
478478
isifelse = instruction(op).instr === :ifelse
479479
reduct_zero = if isifelse
480480
Symbol(name(op), "##BASE##EXTRACT##")
@@ -515,7 +515,7 @@ end
515515

516516
# TODO: handle tiled outer reductions; they will require a suffix arg
517517
function initialize_outer_reductions!(
518-
q::Expr, ls::LoopSet, op::Operation, _Umax::Int, us::UnrollSpecification, rs::Expr
518+
q::Expr, ls::LoopSet, op::Operation, _Umax::Int, us::UnrollSpecification, rs::Union{Expr, StaticInt}
519519
)
520520
@unpack u₁, u₂ = us
521521
Umax = u₂ == -1 ? _Umax : u₁
@@ -541,7 +541,7 @@ function initialize_outer_reductions!(
541541
end
542542
nothing
543543
end
544-
function initialize_outer_reductions!(q::Expr, ls::LoopSet, Umax::Int)
544+
function initialize_outer_reductions!(q::Expr, ls::LoopSet, Umax::Union{Int, StaticInt})
545545
rs = staticexpr(reg_size(ls))
546546
us = ls.unrollspecification
547547
for or ls.outer_reductions

0 commit comments

Comments
 (0)