Go to the documentation of this file.
35 #ifndef LLVM_SUPPORT_OPTIMIZEDSTRUCTLAYOUT_H
36 #define LLVM_SUPPORT_OPTIMIZEDSTRUCTLAYOUT_H
53 assert(
Size > 0 &&
"adding an empty field to the layout");
139 MutableArrayRef<OptimizedStructLayoutField> Fields);
This is an optimization pass for GlobalISel generic memory operations.
uint64_t Offset
The offset of this field in the final layout.
OptimizedStructLayoutField(const void *Id, uint64_t Size, Align Alignment, uint64_t FixedOffset=FlexibleOffset)
This struct is a compact representation of a valid (non-zero power of two) alignment.
Align Alignment
The required alignment of this field.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
uint64_t getEndOffset() const
Given that this field has a fixed offset, return the offset of the first byte following it.
uint64_t Size
The required size of this field in bytes.
std::pair< uint64_t, Align > performOptimizedStructLayout(MutableArrayRef< OptimizedStructLayoutField > Fields)
Compute a layout for a struct containing the given fields, making a best-effort attempt to minimize t...
static constexpr uint64_t FlexibleOffset
A special value for Offset indicating that the field can be moved anywhere.
void * Scratch
Private scratch space for the algorithm.
const void * Id
A opaque value which uniquely identifies this field.
bool hasFixedOffset() const
Return true if this field has been assigned a fixed offset.