Skip to content

Commit 6f715a9

Browse files
committed
remove aggressive const prop (was added as an attempt to fix non-specialization on functions)
1 parent c6d7906 commit 6f715a9

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

src/LoopVectorization.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ LoopVectorization
112112
include("precompile.jl")
113113
_precompile_()
114114

115+
_vreduce(+, Float64[1.0])
116+
115117
# import ChainRulesCore, ForwardDiff
116118
# include("vmap_grad.jl")
117119
function __init__()

src/reconstruct_loopset.jl

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -683,12 +683,6 @@ function _turbo_loopset(
683683
avx_loopset!(ls, instr, ops, arsv, tovector(AMsv), tovector(LPSYMsv), LBsv, vargs)
684684
end
685685

686-
@static if VERSION v"1.7.0-DEV.421"
687-
using Base: @aggressive_constprop
688-
else
689-
macro aggressive_constprop(ex); esc(ex); end
690-
end
691-
692686
"""
693687
_turbo_!(unroll, ops, arf, am, lpsym, lb, vargs...)
694688
@@ -708,7 +702,7 @@ Execute an `@turbo` block. The block's code is represented via the arguments:
708702
`StaticLowerUnitRange(1)` because the lower bound of the iterator can be determined to be 1.
709703
- `vargs...` holds the encoded pointers of all the arrays (see `VectorizationBase`'s various pointer types).
710704
"""
711-
@aggressive_constprop @generated function _turbo_!(
705+
@generated function _turbo_!(
712706
::Val{var"#UNROLL#"}, ::Val{var"#OPS#"}, ::Val{var"#ARF#"}, ::Val{var"#AM#"}, ::Val{var"#LPSYM#"}, ::Val{Tuple{var"#LB#",var"#V#"}}, var"#flattened#var#arguments#"::Vararg{Any,var"#num#vargs#"}
713707
) where {var"#UNROLL#", var"#OPS#", var"#ARF#", var"#AM#", var"#LPSYM#", var"#LB#", var"#V#", var"#num#vargs#"}
714708
1 + 1 # Irrelevant line you can comment out/in to force recompilation...

src/simdfunctionals/mapreduce.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ for (op, init) in zip((:+, :max, :min), (:zero, :typemin, :typemax))
103103
end
104104
end
105105

106-
@eval function _vreduce_dims!(out, ::typeof($op), Rpre, is, Rpost, arg)
106+
@eval @inline function _vreduce_dims!(out, ::typeof($op), Rpre, is, Rpost, arg)
107107
s = $init(first(arg))
108108
@turbo for Ipost in Rpost, Ipre in Rpre
109109
accum = s
@@ -115,7 +115,7 @@ for (op, init) in zip((:+, :max, :min), (:zero, :typemin, :typemax))
115115
return out
116116
end
117117

118-
@eval function _vreduce(::typeof($op), arg)
118+
@eval @inline function _vreduce(::typeof($op), arg)
119119
s = $init(first(arg))
120120
@turbo for i in eachindex(arg)
121121
s = $op(s, arg[i])

src/user_api_conveniences.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,12 @@ end
2323
end
2424
matmul_params() = matmul_params(register_size(), register_count(), cache_linesize())
2525

26+
# function dotturbo(x,y)
27+
# s = zero(promote_type(eltype(x),eltype(y)))
28+
# @turbo for i ∈ eachindex(x,y)
29+
# s += x[i]*y[i]
30+
# end
31+
# s
32+
# end
33+
# dotturbo(Float64[1.0], Float64[2.0])
34+

0 commit comments

Comments
 (0)