24 if (
auto *
I = dyn_cast<GetElementPtrInst>(
this))
25 return I->getSourceElementType();
30 if (
auto *
I = dyn_cast<GetElementPtrInst>(
this))
31 return I->getResultElementType();
39 "The offset bit width does not match DL specification.");
50 if (
StructType *STy = GTI.getStructTypeOrNull()) {
A parsed version of the target data layout string in and methods for querying it. ...
unsigned getIndexSizeInBits(unsigned AS) const
Size in bits of index used for address calculation in getelementptr.
This class represents lattice values for constants.
const StructLayout * getStructLayout(StructType *Ty) const
Returns a StructLayout object, indicating the alignment of the struct, its size, and the offsets of i...
gep_type_iterator gep_type_end(const User *GEP)
unsigned getPointerAddressSpace() const
Method to return the address space of the pointer operand.
unsigned getBitWidth() const
Return the number of bits in the APInt.
bool accumulateConstantOffset(const DataLayout &DL, APInt &Offset) const
Accumulate the constant address offset of this GEP if possible.
Used to lazily calculate structure layout information for a target machine, based on the DataLayout s...
Class to represent struct types.
APInt sextOrTrunc(unsigned width) const
Sign extend or truncate to width.
const APInt & getValue() const
Return the constant as an APInt value reference.
uint64_t getZExtValue() const
Return the constant as a 64-bit unsigned integer value after it has been zero extended as appropriate...
The instances of the Type class are immutable: once they are created, they are never changed...
This is the shared class of boolean and integer constants.
Class for arbitrary precision integers.
Type * getResultElementType() const
uint64_t getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
uint64_t getElementOffset(unsigned Idx) const
bool isZero() const
This is just a convenience method to make client code smaller for a common code.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Type * getSourceElementType() const
gep_type_iterator gep_type_begin(const User *GEP)