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