This relies on existing APIs and avoids accessing the pointer element type. The alternative would be to extend getPointerOperand() to also return the accessed type, but I figured going through MemoryLocation would be cleaner.
Details
Details
Diff Detail
Diff Detail
clang-format: please reformat the code
-static const Value *getMinimalBaseOfPointer( - Attributor &A, const AbstractAttribute &QueryingAA, const Value *Ptr, - int64_t &BytesOffset, const DataLayout &DL, bool AllowNonInbounds = false) { +static const Value * +getMinimalBaseOfPointer(Attributor &A, const AbstractAttribute &QueryingAA, + const Value *Ptr, int64_t &BytesOffset, + const DataLayout &DL, bool AllowNonInbounds = false) {