MachinePointerInfo PtrInfo;
uint64_t Size;
Flags FlagVals;
- uint16_t BaseAlignLog2; // log_2(base_alignment) + 1
+ Align BaseAlign;
MachineAtomicInfo AtomicInfo;
AAMDNodes AAInfo;
const MDNode *Ranges;
/// Return the minimum known alignment in bytes of the base address, without
/// the offset.
- uint64_t getBaseAlignment() const { return (1ull << BaseAlignLog2) >> 1; }
+ uint64_t getBaseAlignment() const { return BaseAlign.value(); }
/// Return the AA tags for the memory reference.
AAMDNodes getAAInfo() const { return AAInfo; }
const MDNode *Ranges, SyncScope::ID SSID,
AtomicOrdering Ordering,
AtomicOrdering FailureOrdering)
- : PtrInfo(ptrinfo), Size(s), FlagVals(f), BaseAlignLog2(Log2_32(a) + 1),
- AAInfo(AAInfo), Ranges(Ranges) {
+ : PtrInfo(ptrinfo), Size(s), FlagVals(f), BaseAlign(a), AAInfo(AAInfo),
+ Ranges(Ranges) {
assert((PtrInfo.V.isNull() || PtrInfo.V.is<const PseudoSourceValue *>() ||
isa<PointerType>(PtrInfo.V.get<const Value *>()->getType())) &&
"invalid pointer value");
if (MMO->getBaseAlignment() >= getBaseAlignment()) {
// Update the alignment value.
- BaseAlignLog2 = Log2_32(MMO->getBaseAlignment()) + 1;
+ BaseAlign = Align(MMO->getBaseAlignment());
// Also update the base and offset, because the new alignment may
// not be applicable with the old ones.
PtrInfo = MMO->PtrInfo;