Skip to content

WIP: Faster Inference #357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/codegen/lower_memory_common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function symbolind(ind::Symbol, op::Operation, td::UnrollArgs, ls::LoopSet)
Symbol(pvar, '_', Core.ifelse(u₁op, u₁, 1)), parent
end

staticexpr(x::Int) = Expr(:call, Expr(:curly, lv(:StaticInt), x))
staticexpr(x::Int) = StaticInt{x}()
staticexpr(x::Union{Symbol,Expr}) = Expr(:call, lv(:StaticInt), x)

_MMind(ind::Union{Symbol,Expr}, str::Int) = Expr(:call, lv(:MM), VECTORWIDTHSYMBOL, ind, staticexpr(str))
Expand Down
6 changes: 3 additions & 3 deletions src/codegen/lowering.jl
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ end
S
end
end
function outer_reduction_zero(op::Operation, u₁u::Bool, Umax::Int, reduct_class::Float64, rs::Expr)
function outer_reduction_zero(op::Operation, u₁u::Bool, Umax::Int, reduct_class::Float64, rs::Union{Expr, StaticInt})
isifelse = instruction(op).instr === :ifelse
reduct_zero = if isifelse
Symbol(name(op), "##BASE##EXTRACT##")
Expand Down Expand Up @@ -515,7 +515,7 @@ end

# TODO: handle tiled outer reductions; they will require a suffix arg
function initialize_outer_reductions!(
q::Expr, ls::LoopSet, op::Operation, _Umax::Int, us::UnrollSpecification, rs::Expr
q::Expr, ls::LoopSet, op::Operation, _Umax::Int, us::UnrollSpecification, rs::Union{Expr, StaticInt}
)
@unpack u₁, u₂ = us
Umax = u₂ == -1 ? _Umax : u₁
Expand All @@ -541,7 +541,7 @@ function initialize_outer_reductions!(
end
nothing
end
function initialize_outer_reductions!(q::Expr, ls::LoopSet, Umax::Int)
function initialize_outer_reductions!(q::Expr, ls::LoopSet, Umax::Union{Int, StaticInt})
rs = staticexpr(reg_size(ls))
us = ls.unrollspecification
for or ∈ ls.outer_reductions
Expand Down