@@ -171,16 +171,6 @@ function rank_to_sortperm(R::NTuple{N,Int}) where {N}
171
171
end
172
172
sp
173
173
end
174
- # sptrs::Expr, ls::LoopSet, ar::ArrayReferenceMeta, @nospecialize(_::Type{Core.LLVMPtr{T,0}}),
175
- function add_mref! (
176
- sptrs:: Expr , ls:: LoopSet , ar:: ArrayReferenceMeta , @nospecialize (_:: Type{Ptr{T}} ),
177
- C:: Int , B:: Int , sp:: NTuple{N,Int} , name:: Symbol
178
- ) where {T,N}
179
- Tsym:: Symbol = get (VectorizationBase. JULIA_TYPES, T) do
180
- Symbol (T)
181
- end
182
- add_mref_ptr! (sptrs, ls, ar, Tsym, C, B, sp, name)
183
- end
184
174
function loop_indexes_bit! (ls:: LoopSet , ar:: ArrayReferenceMeta )
185
175
li = ar. loopedindex;
186
176
ind = first (getindices (ar))
@@ -189,17 +179,17 @@ function loop_indexes_bit!(ls::LoopSet, ar::ArrayReferenceMeta)
189
179
ls. loopindexesbit[getloopid (ls,ind)] = true
190
180
nothing
191
181
end
192
- function add_mref_ptr ! (
193
- sptrs:: Expr , ls:: LoopSet , ar:: ArrayReferenceMeta , Tsym :: Symbol ,
182
+ function add_mref ! (
183
+ sptrs:: Expr , ls:: LoopSet , ar:: ArrayReferenceMeta , @nospecialize (_ :: Type{Ptr{T}} ) ,
194
184
C:: Int , B:: Int , sp:: NTuple{N,Int} , name:: Symbol
195
- ) where {N}
185
+ ) where {T, N}
196
186
@assert B ≤ 0 " Batched arrays not supported yet."
197
187
# maybe no change needed? -- optimize common case
198
188
column_major = ntuple (identity, N)
199
189
li = ar. loopedindex;
200
190
if sp === column_major || isone (length (li))
201
191
# don't set `bit` to true if our vector width is ≥ 8
202
- ((Tsym === : Bit ) && (ls. vector_width[] < 8 )) && loop_indexes_bit! (ls, ar)
192
+ ((T === VectorizationBase . Bit) && (ls. vector_width[] < 8 )) && loop_indexes_bit! (ls, ar)
203
193
return extract_gsp! (sptrs, name)
204
194
end
205
195
permute_mref! (ar, C, sp)
@@ -216,8 +206,8 @@ function add_mref_ptr!(
216
206
push! (strd_tup. args, Expr (:call , gf, strides, p, false ))
217
207
push! (offsets_tup. args, Expr (:call , gf, offsets, p, false ))
218
208
end
219
- # TODO : fix for `Tsym === Bit`.
220
- sptype = Expr (:curly , lv (:StridedPointer ), Tsym , N, (C == - 1 ? - 1 : 1 ), B, column_major)
209
+ # TODO : fix for `T === Bit`.
210
+ sptype = Expr (:curly , lv (:StridedPointer ), T , N, (C == - 1 ? - 1 : 1 ), B, column_major)
221
211
sptr = Expr (:call , sptype, Expr (:call , :pointer , tmpsp), strd_tup, offsets_tup)
222
212
pushpreamble! (ls, Expr (:(= ), name, sptr))
223
213
nothing
0 commit comments