[llvm] [CodeGen] Get stack alignment from TargetFrameLowering (PR #105477)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 21 02:46:39 PDT 2024


================
@@ -9241,9 +9242,10 @@ LegalizerHelper::lowerMemmove(MachineInstr &MI, Register Dst, Register Src,
     // Don't promote to an alignment that would require dynamic stack
     // realignment.
     const TargetRegisterInfo *TRI = MF.getSubtarget().getRegisterInfo();
-    if (!TRI->hasStackRealignment(MF))
-      while (NewAlign > Alignment && DL.exceedsNaturalStackAlignment(NewAlign))
-        NewAlign = NewAlign.previous();
+    if (NewAlign > Alignment && !TRI->hasStackRealignment(MF)) {
+      const TargetFrameLowering *TFL = MF.getSubtarget().getFrameLowering();
----------------
s-barannikov wrote:

The DataLayout one is used in similar scenarios, but in middle end passes. I.e. when promoting alloca alignment.


https://github.com/llvm/llvm-project/pull/105477


More information about the llvm-commits mailing list