File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -1312,6 +1312,18 @@ class LoopVectorizationCostModel {
13121312 (SI && TTI.isLegalMaskedScatter (Ty, Align));
13131313 }
13141314
1315+ // / Returns true if the target machine can represent \p V as a strided load
1316+ // / or store operation.
1317+ bool isLegalStridedLoadStore (Value *V, ElementCount VF) {
1318+ if (!isa<LoadInst, StoreInst>(V))
1319+ return false ;
1320+ auto *Ty = getLoadStoreType (V);
1321+ Align Align = getLoadStoreAlignment (V);
1322+ if (VF.isVector ())
1323+ Ty = VectorType::get (Ty, VF);
1324+ return TTI.isLegalStridedLoadStore (Ty, Align);
1325+ }
1326+
13151327 // / Returns true if the target machine supports all of the reduction
13161328 // / variables found for the given VF.
13171329 bool canVectorizeReductions (ElementCount VF) const {
You can’t perform that action at this time.
0 commit comments