Analyze the specified pointer to see if it can be expressed as a base pointer plus a constant offset. Return the base and offset to the caller.
Declared in <llvm/Analysis/ValueTracking.h>
Value*
GetPointerBaseWithConstantOffset(
Value* Ptr,
int64_t& Offset,
DataLayout const& DL,
bool AllowNonInbounds = true);
This is a wrapper around Value::stripAndAccumulateConstantOffsets that creates and later unpacks the required APInt.
Base pointer after stripping constant offsets.
| Name | Description |
|---|---|
| Ptr | Pointer to decompose into base plus offset. |
| Offset | Output constant offset from the returned base. |
| DL | Data layout used for pointer index sizes. |
| AllowNonInbounds | Whether non-inbounds GEPs may contribute offsets. |