llvm::simplifyGEPInst

Given operands for a GetElementPtrInst, fold the result or return null.

Synopsis

Declared in <llvm/Analysis/InstructionSimplify.h>

Value*
simplifyGEPInst(
    Type* SrcTy,
    Value* Ptr,
    ArrayRef<Value*> Indices,
    GEPNoWrapFlags NW,
    SimplifyQuery const& Q);

Return Value

The folded value, or null if no simplification was found.

Parameters

NameDescription
SrcTySource element type of the GEP.
PtrBase pointer operand.
IndicesIndex operands of the GEP.
NWNo-wrap flags of the GEP.
QSimplification query providing analyses and flags.