[PATCH] D77079: [Alignment][NFC] GlobalIsel Utils inferAlignFromPtrInfo
Guillaume Chatelet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 31 00:31:10 PDT 2020
This revision was automatically updated to reflect the committed changes.
gchatelet marked an inline comment as done.
Closed by commit rGd2d6c9f59197: [Alignment][NFC] GlobalIsel Utils inferAlignFromPtrInfo (authored by gchatelet).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77079/new/
https://reviews.llvm.org/D77079
Files:
llvm/include/llvm/CodeGen/GlobalISel/Utils.h
llvm/lib/CodeGen/GlobalISel/Utils.cpp
Index: llvm/lib/CodeGen/GlobalISel/Utils.cpp
===================================================================
--- llvm/lib/CodeGen/GlobalISel/Utils.cpp
+++ llvm/lib/CodeGen/GlobalISel/Utils.cpp
@@ -457,15 +457,16 @@
return false;
}
-unsigned llvm::inferAlignmentFromPtrInfo(MachineFunction &MF,
- const MachinePointerInfo &MPO) {
+Align llvm::inferAlignFromPtrInfo(MachineFunction &MF,
+ const MachinePointerInfo &MPO) {
auto PSV = MPO.V.dyn_cast<const PseudoSourceValue *>();
if (auto FSPV = dyn_cast_or_null<FixedStackPseudoSourceValue>(PSV)) {
MachineFrameInfo &MFI = MF.getFrameInfo();
- return MinAlign(MFI.getObjectAlignment(FSPV->getFrameIndex()), MPO.Offset);
+ return commonAlignment(MFI.getObjectAlign(FSPV->getFrameIndex()),
+ MPO.Offset);
}
- return 1;
+ return Align(1);
}
Optional<APInt> llvm::ConstantFoldExtOp(unsigned Opcode, const unsigned Op1,
Index: llvm/include/llvm/CodeGen/GlobalISel/Utils.h
===================================================================
--- llvm/include/llvm/CodeGen/GlobalISel/Utils.h
+++ llvm/include/llvm/CodeGen/GlobalISel/Utils.h
@@ -16,6 +16,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/CodeGen/Register.h"
+#include "llvm/Support/Alignment.h"
#include "llvm/Support/LowLevelTypeImpl.h"
#include "llvm/Support/MachineValueType.h"
@@ -181,8 +182,13 @@
return isKnownNeverNaN(Val, MRI, true);
}
-unsigned inferAlignmentFromPtrInfo(MachineFunction &MF,
- const MachinePointerInfo &MPO);
+Align inferAlignFromPtrInfo(MachineFunction &MF, const MachinePointerInfo &MPO);
+
+/// FIXME: Remove once the transition to Align is over.
+inline unsigned inferAlignmentFromPtrInfo(MachineFunction &MF,
+ const MachinePointerInfo &MPO) {
+ return inferAlignFromPtrInfo(MF, MPO).value();
+}
/// Return the least common multiple type of \p Ty0 and \p Ty1, by changing
/// the number of vector elements or scalar bitwidth. The intent is a
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77079.253792.patch
Type: text/x-patch
Size: 2111 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200331/2ce32af3/attachment-0001.bin>
More information about the llvm-commits
mailing list