[llvm] 90f96ec - [NFC][Alignment] Remove assumeAligned from MachineFrameInfo ctor

Guillaume Chatelet via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 17 08:21:28 PDT 2022


Author: Guillaume Chatelet
Date: 2022-06-17T15:21:17Z
New Revision: 90f96ec7a52e840cdc65035cb3beca620032be69

URL: https://github.com/llvm/llvm-project/commit/90f96ec7a52e840cdc65035cb3beca620032be69
DIFF: https://github.com/llvm/llvm-project/commit/90f96ec7a52e840cdc65035cb3beca620032be69.diff

LOG: [NFC][Alignment] Remove assumeAligned from MachineFrameInfo ctor

Added: 
    

Modified: 
    llvm/include/llvm/CodeGen/MachineFrameInfo.h
    llvm/lib/CodeGen/MachineFunction.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/CodeGen/MachineFrameInfo.h b/llvm/include/llvm/CodeGen/MachineFrameInfo.h
index edf6e51b4be5e..7ea731b466559 100644
--- a/llvm/include/llvm/CodeGen/MachineFrameInfo.h
+++ b/llvm/include/llvm/CodeGen/MachineFrameInfo.h
@@ -338,9 +338,9 @@ class MachineFrameInfo {
   uint64_t UnsafeStackSize = 0;
 
 public:
-  explicit MachineFrameInfo(unsigned StackAlignment, bool StackRealignable,
+  explicit MachineFrameInfo(Align StackAlignment, bool StackRealignable,
                             bool ForcedRealign)
-      : StackAlignment(assumeAligned(StackAlignment)),
+      : StackAlignment(StackAlignment),
         StackRealignable(StackRealignable), ForcedRealign(ForcedRealign) {}
 
   MachineFrameInfo(const MachineFrameInfo &) = delete;

diff  --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp
index eabcb2b34cb18..f58996ea90c69 100644
--- a/llvm/lib/CodeGen/MachineFunction.cpp
+++ b/llvm/lib/CodeGen/MachineFunction.cpp
@@ -152,11 +152,11 @@ void ilist_alloc_traits<MachineBasicBlock>::deleteNode(MachineBasicBlock *MBB) {
   MBB->getParent()->deleteMachineBasicBlock(MBB);
 }
 
-static inline unsigned getFnStackAlignment(const TargetSubtargetInfo *STI,
+static inline Align getFnStackAlignment(const TargetSubtargetInfo *STI,
                                            const Function &F) {
   if (auto MA = F.getFnStackAlign())
-    return MA->value();
-  return STI->getFrameLowering()->getStackAlign().value();
+    return *MA;
+  return STI->getFrameLowering()->getStackAlign();
 }
 
 MachineFunction::MachineFunction(Function &F, const LLVMTargetMachine &Target,


        


More information about the llvm-commits mailing list