Attempt to constant fold a getelementptr instruction with the specified operands.
Declared in <llvm/IR/ConstantFold.h>
Constant*
ConstantFoldGetElementPtr(
Type* Ty,
Constant* C,
std::optional<ConstantRange> InRange,
ArrayRef<Value*> Idxs);
The constant result is returned if successful; if not, null is returned.
The folded constant, or null if the GEP cannot be folded.
| 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. |