Skip to content

Commit 7301b41

Browse files
committed
Fix check for u1loop axis in unrolled_curly
1 parent 331288a commit 7301b41

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/codegen/lower_memory_common.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ function unrolled_curly(op::Operation, u₁::Int, u₁loop::Loop, vloop::Loop, m
204204
@assert AV == -1
205205
AV = n
206206
end
207-
if (u₁loopsym === CONSTANTZEROINDEX) ? (CONSTANTZEROINDEX loopdependencies(opp)) : (isu₁unrolled(opp))
207+
if (u₁loopsym === CONSTANTZEROINDEX) ? (CONSTANTZEROINDEX loopdependencies(opp)) : (isu₁unrolled(opp) || (ind === u₁loopsym))
208208
@assert AU == -1
209209
AU = n
210210
end
@@ -214,6 +214,11 @@ function unrolled_curly(op::Operation, u₁::Int, u₁loop::Loop, vloop::Loop, m
214214
# return mem_offset_u(op, td, inds_calc_by_ptr_offset, true)
215215
# end
216216
# ind = mem_offset_u(op, td, inds_calc_by_ptr_offset, false)
217+
# if AU == -1
218+
# @show op indices u₁loopsym vloopsym
219+
# end
220+
AU == -1 && throw(LoopError("Failed to find $(u₁loopsym) in args of $(repr(op))."))
221+
# @assert AU ≠ -1
217222
vecnotunrolled = AU != AV
218223
conditional_memory_op = isconditionalmemop(op)
219224
if mask || conditional_memory_op

src/reconstruct_loopset.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ Execute an `@avx` block. The block's code is represented via the arguments:
630630
@generated function _avx_!(
631631
::Val{UNROLL}, ::Val{OPS}, ::Val{ARF}, ::Val{AM}, ::Val{LPSYM}, var"#lv#tuple#args#"::Tuple{LB,V}
632632
) where {UNROLL, OPS, ARF, AM, LPSYM, LB, V}
633-
1 + 1 # Irrelevant line you can comment out/in to force recompilation...
633+
# 1 + 1 # Irrelevant line you can comment out/in to force recompilation...
634634
ls = _avx_loopset(OPS, ARF, AM, LPSYM, LB.parameters, V.parameters, UNROLL)
635635
# return @show avx_body(ls, UNROLL)
636636
if last(UNROLL) > 1

0 commit comments

Comments
 (0)