ΒΆllvm::Align getOrEnforceKnownAlignment(
    llvm::Value* V,
    llvm::MaybeAlign PrefAlign,
    const llvm::DataLayout& DL,
    const llvm::Instruction* CxtI = nullptr,
    llvm::AssumptionCache* AC = nullptr,
    const llvm::DominatorTree* DT = nullptr)

Description

Try to ensure that the alignment of \p V is at least \p PrefAlign bytes. If the owning object can be modified and has an alignment less than \p PrefAlign, it will be increased and \p PrefAlign returned. If the alignment cannot be increased, the known alignment of the value is returned. 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.

Declared at: llvm/include/llvm/Transforms/Utils/Local.h:215

Parameters

llvm::Value* V
llvm::MaybeAlign PrefAlign
const llvm::DataLayout& DL
const llvm::Instruction* CxtI = nullptr
llvm::AssumptionCache* AC = nullptr
const llvm::DominatorTree* DT = nullptr