diff options
author | Guillaume Chatelet <gchatelet@google.com> | 2020-03-26 15:58:11 +0000 |
---|---|---|
committer | Guillaume Chatelet <gchatelet@google.com> | 2020-03-27 08:06:10 +0000 |
commit | a98662f4c15e91b697e589ac93a39777a62bfb64 (patch) | |
tree | 438db1a0262a25df14438a8d396c6ff22c00b4aa /llvm/lib/CodeGen/MachineOperand.cpp | |
parent | 6728a9ae1959a1c9519fed3d483733efeb8940a1 (diff) | |
download | llvm-a98662f4c15e91b697e589ac93a39777a62bfb64.zip llvm-a98662f4c15e91b697e589ac93a39777a62bfb64.tar.gz llvm-a98662f4c15e91b697e589ac93a39777a62bfb64.tar.bz2 |
[Alignment][NFC] Update MachineMemOperand implementation to use MaybeAlign
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Reviewed By: courbet
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76625
Diffstat (limited to 'llvm/lib/CodeGen/MachineOperand.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineOperand.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineOperand.cpp b/llvm/lib/CodeGen/MachineOperand.cpp index c7cbd9e..47d1c68 100644 --- a/llvm/lib/CodeGen/MachineOperand.cpp +++ b/llvm/lib/CodeGen/MachineOperand.cpp @@ -1009,8 +1009,8 @@ MachineMemOperand::MachineMemOperand(MachinePointerInfo ptrinfo, Flags f, 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"); @@ -1043,7 +1043,7 @@ void MachineMemOperand::refineAlignment(const MachineMemOperand *MMO) { 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; |