Lines Matching full:stride
44 // Cache of the BasePtr and Stride determined from this GEP. When a GEP is
73 bool matchStridedRecurrence(Value *Index, Loop *L, Value *&Stride,
89 // TODO: Should we consider the mask when looking for a stride?
117 Value *Stride = ConstantInt::get(StartVal->getType(), StrideVal); in matchStridedConstant() local
119 return std::make_pair(StartVal, Stride); in matchStridedConstant()
158 Value *Stride; in matchStridedStart() local
159 std::tie(Start, Stride) = matchStridedStart(BO->getOperand(OtherIndex), in matchStridedStart()
166 // Add the splat value to the start or multiply the start and stride by the in matchStridedStart()
180 Stride = Builder.CreateMul(Stride, Splat); in matchStridedStart()
184 Stride = Builder.CreateShl(Stride, Splat); in matchStridedStart()
188 return std::make_pair(Start, Stride); in matchStridedStart()
193 // We also update the Stride as we unwind. Our goal is to move all of the
196 Value *&Stride, in matchStridedRecurrence() argument
225 std::tie(Start, Stride) = matchStridedStart(Start, Builder); in matchStridedRecurrence()
228 assert(Stride != nullptr); in matchStridedRecurrence()
289 if (!matchStridedRecurrence(Index, L, Stride, BasePtr, Inc, Builder)) in matchStridedRecurrence()
316 Stride = Builder.CreateMul(Stride, SplatOp, "stride"); in matchStridedRecurrence()
322 Stride = Builder.CreateShl(Stride, SplatOp, "stride"); in matchStridedRecurrence()
359 auto [BaseBase, Stride] = determineBaseAndStride(BaseInst, Builder); in determineBaseAndStride()
366 return {OffsetBase, Stride}; in determineBaseAndStride()
404 // We can't extract the stride if the arithmetic is done at a different size in determineBaseAndStride()
405 // than the pointer type. Adding the stride later may not wrap correctly. in determineBaseAndStride()
423 auto [Start, Stride] = matchStridedStart(VecIndex, Builder); in determineBaseAndStride()
425 assert(Stride); in determineBaseAndStride()
434 // Convert stride to pointer size if needed. in determineBaseAndStride()
436 assert(Stride->getType() == IntPtrTy && "Unexpected type"); in determineBaseAndStride()
438 // Scale the stride by the size of the indexed type. in determineBaseAndStride()
440 Stride = Builder.CreateMul(Stride, ConstantInt::get(IntPtrTy, TypeScale)); in determineBaseAndStride()
442 auto P = std::make_pair(BasePtr, Stride); in determineBaseAndStride()
454 if (!matchStridedRecurrence(VecIndex, L, Stride, BasePhi, Inc, Builder)) in determineBaseAndStride()
470 // Final adjustments to stride should go in the start block. in determineBaseAndStride()
474 // Convert stride to pointer size if needed. in determineBaseAndStride()
476 assert(Stride->getType() == IntPtrTy && "Unexpected type"); in determineBaseAndStride()
478 // Scale the stride by the size of the indexed type. in determineBaseAndStride()
480 Stride = Builder.CreateMul(Stride, ConstantInt::get(IntPtrTy, TypeScale)); in determineBaseAndStride()
482 auto P = std::make_pair(BasePtr, Stride); in determineBaseAndStride()
510 Value *BasePtr, *Stride; in tryCreateStridedLoadStore() local
511 std::tie(BasePtr, Stride) = determineBaseAndStride(PtrI, Builder); in tryCreateStridedLoadStore()
514 assert(Stride != nullptr); in tryCreateStridedLoadStore()
522 {DataType, BasePtr->getType(), Stride->getType()}, in tryCreateStridedLoadStore()
523 {II->getArgOperand(3), BasePtr, Stride, II->getArgOperand(2)}); in tryCreateStridedLoadStore()
527 {DataType, BasePtr->getType(), Stride->getType()}, in tryCreateStridedLoadStore()
528 {II->getArgOperand(0), BasePtr, Stride, II->getArgOperand(3)}); in tryCreateStridedLoadStore()