Skip to content

Commit 8d6d8d9

Browse files
committed
Remove unnessary branch for static length loops.
1 parent 5761a0e commit 8d6d8d9

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "LoopVectorization"
22
uuid = "bdcacae8-1622-11e9-2a5c-532679323890"
33
authors = ["Chris Elrod <[email protected]>"]
4-
version = "0.8.16"
4+
version = "0.8.17"
55

66
[deps]
77
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"

src/lowering.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -340,19 +340,19 @@ function lower_unrolled_dynamic(ls::LoopSet, us::UnrollSpecification, n::Int, in
340340
usorig = ls.unrollspecification[]
341341
# tc = (usorig.u₁ == us.u₁) && (usorig.u₂ == us.u₂) && !loopisstatic && !inclmask && !ls.loadelimination[] ? expect(tc) : tc
342342
body = lower_block(ls, us, n, inclmask, UF)
343-
q = if loopisstatic
343+
if loopisstatic
344344
iters = length(loop) ÷ UFW
345345
if iters*UF 16 # Let's set a limit on total unrolling
346346
q = Expr(:block)
347347
foreach(_ -> push!(q.args, body), 1:iters)
348-
q
349348
else
350-
Expr(:while, tc, body)
349+
q = Expr(:while, tc, body)
351350
end
351+
remblock = Expr(:block)
352352
else
353-
Expr(:while, tc, body)
353+
remblock = init_remblock(loop, ls.lssm[], n)#loopsym)
354+
q = Expr(:while, tc, body)
354355
end
355-
remblock = init_remblock(loop, ls.lssm[], n)#loopsym)
356356
q = if unsigned(Ureduct) < unsigned(UF) # unsigned(-1) == typemax(UInt); is logic relying on twos-complement bad?
357357
UF_cleanup = UF - Ureduct
358358
us_cleanup = nisunrolled ? UnrollSpecification(us, UF_cleanup, u₂) : UnrollSpecification(us, u₁, UF_cleanup)

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ using LinearAlgebra
55
# const START_TIME = time()
66
# exceeds_time_limit() = (time() - START_TIME) > 35 * 60
77

8-
function clenshaw(x,coeff)
8+
function clenshaw(x, coeff)
99
len_c = length(coeff)
1010
tmp = zero(x)
1111
ret = zero(x)

0 commit comments

Comments
 (0)