Try to ensure that the alignment of V is at least PrefAlign bytes. If the owning object can be modified and has an alignment less than PrefAlign, it will be increased and PrefAlign returned. If the alignment cannot be increased, the known alignment of the value is returned.
Declared in <llvm/Transforms/Utils/Local.h>
Align
getOrEnforceKnownAlignment(
Value* V,
MaybeAlign PrefAlign,
DataLayout const& DL,
Instruction const* CxtI = nullptr,
AssumptionCache* AC = nullptr,
DominatorTree const* DT = nullptr);
It is not always possible to modify the alignment of the underlying object, so if alignment is important, a more reliable approach is to simply align all global variables and allocation instructions to their preferred alignment from the beginning.
This struct is a compact representation of a valid (non-zero power of two) alignment. It is suitable for use as static global constants.
| Name | Description |
|---|---|
| V | LLVM Value Representation |
| PrefAlign | This struct is a compact representation of a valid (power of two) or undefined (0) alignment. |
| DL | A parsed version of the target data layout string in and methods for querying it. |
| AC | A cache of @llvm.assume calls within a function. |
| DT | Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree. |