[llvm] [CodeGen] Get stack alignment from TargetFrameLowering (NFCI) (PR #105477)
Sergei Barannikov via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 21 01:06:58 PDT 2024
================
@@ -9133,9 +9133,10 @@ LegalizerHelper::lowerMemcpy(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();
+ NewAlign = std::min(NewAlign, TFL->getStackAlign());
+ }
----------------
s-barannikov wrote:
Thanks for the suggestion. I'll try to find a common place, or maybe you can suggest one?
https://github.com/llvm/llvm-project/pull/105477
More information about the llvm-commits
mailing list