llvm::LoopVectorizationLegality::isConsecutivePtr

Return whether Ptr is consecutive when vectorizing AccessTy.

Synopsis

Declared in <llvm/Transforms/Vectorize/LoopVectorizationLegality.h>

int
isConsecutivePtr(
    Type* AccessTy,
    Value* Ptr) const;

Description

This happens when the last index of the GEP is the induction variable, or that the pointer itself is an induction variable. This check allows us to vectorize A[idx]into a wide load/store. Returns: 0 - Stride is unknown or non-consecutive. 1 - Address is consecutive. -1 - Address is consecutive, and decreasing. NOTE: This method must only be used before modifying the original scalar loop. Do not use after invoking 'createVectorizedLoopSkeleton' (PR34965).

Return Value

0 if the stride is unknown or non-consecutive, 1 if consecutive and increasing, or -1 if consecutive and decreasing.

Parameters

NameDescription
AccessTyElement type of the memory access through Ptr.
PtrPointer value to test for consecutive access.