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);
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This is an optimization pass for GlobalISel generic memory operations.
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...
This struct is a compact representation of a valid (non-zero power of two) alignment.
const void * Id
A opaque value which uniquely identifies this field.
Align Alignment
The required alignment of this field.
uint64_t getEndOffset() const
Given that this field has a fixed offset, return the offset of the first byte following it.
void * Scratch
Private scratch space for the algorithm.
bool hasFixedOffset() const
Return true if this field has been assigned a fixed offset.
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)
uint64_t Size
The required size of this field in bytes.
static constexpr uint64_t FlexibleOffset
A special value for Offset indicating that the field can be moved anywhere.