Try to raise a controlled object's alignment to a preferred value.
Declared in <llvm/Transforms/Utils/Local.h>
Align
tryEnforceAlignment(
Value* V,
Align PrefAlign,
DataLayout const& DL);
If the specified pointer points to an object that we control, try to modify the object's alignment to PrefAlign. Returns a minimum known alignment of the value after the operation, which may be lower than PrefAlign.
Increating value alignment isn't often possible though. 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.
Minimum known alignment of the value after the operation.
| Name | Description |
|---|---|
| V | Pointer value whose underlying object may be realigned. |
| PrefAlign | Preferred alignment to try to enforce. |
| DL | Data layout used to reason about object alignment. |