[PATCH] D76570: [AArch64] Homogeneous Prolog and Epilog for Size Optimization

Kyungwoo Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 9 00:41:41 PDT 2020


kyulee marked an inline comment as done.
kyulee added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64FrameLowering.cpp:241
+
+bool AArch64FrameLowering::producePairRegisters(MachineFunction &MF) const {
+  return produceCompactUnwindFrame(MF) || homogeneousPrologEpilog(MF);
----------------
plotfi wrote:
> This is so small that I feel it would be more descriptive at the call site of SavedRegs.set/test to have:
> 
> ```
> /// true if CSRs should be paired
> const bool producePairRegisters = produceCompactUnwindFrame(MF) || homogeneousPrologEpilog(MF);
> ```
> 
> With some additional comments on the register paring in the context of homogenous-prolog-epilog.
Updated the comment.


================
Comment at: llvm/lib/Target/AArch64/AArch64FrameLowering.cpp:1515
   // in the epilogue, the residual adjustment is executed first.
-  uint64_t ArgumentPopSize = 0;
-  if (IsTailCallReturn) {
-    MachineOperand &StackAdjust = MBBI->getOperand(1);
-
-    // For a tail-call in a callee-pops-arguments environment, some or all of
-    // the stack may actually be in use for the call's arguments, this is
-    // calculated during LowerCall and consumed here...
-    ArgumentPopSize = StackAdjust.getImm();
-  } else {
-    // ... otherwise the amount to pop is *all* of the argument space,
-    // conveniently stored in the MachineFunctionInfo by
-    // LowerFormalArguments. This will, of course, be zero for the C calling
-    // convention.
-    ArgumentPopSize = AFI->getArgumentStackToRestore();
-  }
+  uint64_t ArgumentPopSize = getArgumentPopSize(MF, MBB);
 
----------------
plotfi wrote:
> Is the bit that was removed a non-functional change here? If so, can this be a separate NFC commit? 
It's refactored to D83456.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76570/new/

https://reviews.llvm.org/D76570





More information about the llvm-commits mailing list