ΒΆOptional<int> getPointersDiff(
    llvm::Type* ElemTyA,
    llvm::Value* PtrA,
    llvm::Type* ElemTyB,
    llvm::Value* PtrB,
    const llvm::DataLayout& DL,
    llvm::ScalarEvolution& SE,
    bool StrictCheck = false,
    bool CheckType = true)

Description

Returns the distance between the pointers \p PtrA and \p PtrB iff they are compatible and it is possible to calculate the distance between them. This is a simple API that does not depend on the analysis pass.

Declared at: llvm/include/llvm/Analysis/LoopAccessAnalysis.h:742

Parameters

llvm::Type* ElemTyA
llvm::Value* PtrA
llvm::Type* ElemTyB
llvm::Value* PtrB
const llvm::DataLayout& DL
llvm::ScalarEvolution& SE
bool StrictCheck = false
Ensure that the calculated distance matches the type-based one after all the bitcasts removal in the provided pointers.
bool CheckType = true