Attempt to constant fold a getelementptr instruction with the specified operands.

Synopsis

Declared in <llvm/IR/ConstantFold.h>

Constant*
ConstantFoldGetElementPtr(
    Type* Ty,
    Constant* C,
    std::optional<ConstantRange> InRange,
    ArrayRef<Value*> Idxs);

Description

The constant result is returned if successful; if not, null is returned.

Return Value

The folded constant, or null if the GEP cannot be folded.

Parameters

Name

Description

Ty

The source element type for the GEP.

C

The pointer operand.

InRange

The inrange range if present, or std::nullopt.

Idxs

The index operands.

Created with MrDocs