ΒΆvoid getUnderlyingObjects(
    const llvm::Value* V,
    SmallVectorImpl<const llvm::Value*>& Objects,
    llvm::LoopInfo* LI = nullptr,
    unsigned int MaxLookup = 6)

Description

This method is similar to getUnderlyingObject except that it can look through phi and select instructions and return multiple objects. If LoopInfo is passed, loop phis are further analyzed. If a pointer accesses different objects in each iteration, we don't look through the phi node. E.g. consider this loop nest: int **A; for (i) for (j) { A[i][j] = A[i-1][j] * B[j] } This is transformed by Load-PRE to stash away A[i] for the next iteration of the outer loop: Curr = A[0]; // Prev_0 for (i: 1..N) { Prev = Curr; // Prev = PHI (Prev_0, Curr) Curr = A[i]; for (j: 0..N) { Curr[j] = Prev[j] * B[j] } } Since A[i] and A[i-1] are independent pointers, getUnderlyingObjects should not assume that Curr and Prev share the same underlying object thus it shouldn't look through the phi above.

Declared at: llvm/include/llvm/Analysis/ValueTracking.h:407

Parameters

const llvm::Value* V
SmallVectorImpl<const llvm::Value*>& Objects
llvm::LoopInfo* LI = nullptr
unsigned int MaxLookup = 6