[PATCH] D128881: [RISCV] Avoid unnecessary stack align

luxufan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 29 23:19:09 PDT 2022


StephenFan created this revision.
StephenFan added reviewers: asb, craig.topper, frasercrmck, kito-cheng.
Herald added subscribers: sunshaoce, VincentWu, luke957, vkmr, evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya, arichardson.
Herald added a project: All.
StephenFan requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.

The stack align is done in PEI's `calculateFrameObjectOffsets` method.
Here we don't need to do stack align again.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D128881

Files:
  llvm/lib/Target/RISCV/RISCVFrameLowering.cpp


Index: llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
===================================================================
--- llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
+++ llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
@@ -255,15 +255,6 @@
   // Get the number of bytes to allocate from the FrameInfo.
   uint64_t FrameSize = MFI.getStackSize();
 
-  // Get the alignment.
-  Align StackAlign = getStackAlign();
-
-  // Make sure the frame is aligned.
-  FrameSize = alignTo(FrameSize, StackAlign);
-
-  // Update frame info.
-  MFI.setStackSize(FrameSize);
-
   // When using SP or BP to access stack objects, we may require extra padding
   // to ensure the bottom of the RVV stack is correctly aligned within the main
   // stack. We calculate this as the amount required to align the scalar local


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128881.441273.patch
Type: text/x-patch
Size: 800 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220630/38bed081/attachment.bin>


More information about the llvm-commits mailing list