207
207
is_row_major (x) = is_column_major (reverse (x))
208
208
_find_arg_least_greater (r:: Vector{Int} , i) =
209
209
findmin (x -> x > i ? x : typemax (Int), r)
210
- # @inline _bytestrides(s,paren) = VectorizationBase.bytestrides(paren)
210
+
211
211
function _strides_expr (
212
212
@nospecialize (s),
213
213
@nospecialize (x),
@@ -217,6 +217,7 @@ function _strides_expr(
217
217
N = length (R)
218
218
q = Expr (:block , Expr (:meta , :inline ))
219
219
strd_tup = Expr (:tuple )
220
+ resize! (strd_tup. args, N)
220
221
ifel = GlobalRef (Core, :ifelse )
221
222
Nrange = 1 : N # type stability w/ respect to reverse
222
223
# Nrange = 1:1:N # type stability w/ respect to reverse
@@ -237,22 +238,20 @@ function _strides_expr(
237
238
if sₙ_static
238
239
sₙ_value = s_type. parameters[1 ]
239
240
if s_type === One
240
- push! ( strd_tup. args, Expr (:call , lv (:Zero ) ))
241
+ strd_tup. args[n] = Expr (:call , lv (:Zero ))
241
242
elseif stride_acc ≠ 0
242
- push! ( strd_tup. args, staticexpr (stride_acc) )
243
+ strd_tup. args[n] = staticexpr (stride_acc)
243
244
else
244
- push! ( strd_tup. args, :($ getfield (x, $ n) ))
245
+ strd_tup. args[n] = :($ getfield (x, $ n))
245
246
end
246
247
else
247
248
if xₙ_static
248
- push! ( strd_tup. args, staticexpr (xₙ_value) )
249
+ strd_tup. args[n] = staticexpr (xₙ_value)
249
250
elseif stride_acc ≠ 0
250
- push! ( strd_tup. args, staticexpr (stride_acc) )
251
+ strd_tup. args[n] = staticexpr (stride_acc)
251
252
else
252
- push! (
253
- strd_tup. args,
253
+ strd_tup. args[n] =
254
254
:($ ifel (isone ($ getfield (s, $ n)), zero ($ xₙ_type), $ getfield (x, $ n)))
255
- )
256
255
end
257
256
end
258
257
if (_n ≠ N)
0 commit comments