[PATCH] D89239: [RISCV][PrologEpilogInserter] "Float" emergency spill slots to avoid making them immediately unreachable from the stack pointer

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 16 07:18:26 PST 2020


sdesmalen added a comment.

@rogfer01 the changes to the aarch64 tests seem fine to me.



================
Comment at: llvm/lib/CodeGen/PrologEpilogInserter.cpp:1092
+      int64_t Delta = Offset - OffsetBeforeAlignment;
+      for (SmallVectorImpl<int>::iterator I = SFIs.begin(), IE = SFIs.end();
+           I != IE; ++I) {
----------------
rogfer01 wrote:
> sdesmalen wrote:
> > Is this approach the same as setting the alignment of the last SFI to StackAlign?
> Not sure I understood you comment.
> 
> This removes the additional offset that was introduced in line 1081 for all the SFIs, not only the last one.
You're right, these are all allocated individually, so changing the alignment of the last SFI would indeed only affect the position of that one.

I guess I was thinking along the lines to what is done for the Local stack allocation block. i.e. allocate the SFIs together as one block (in this case aligned to the stack alignment), and then adjust the individual offsets for each of the SFIs? That would place the logic for this in one place. Now it first assigns offsets for the slots, then calculates stack alignment, and then fixes up the offsets based on the stack alignment. Is that something you have considered?


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

https://reviews.llvm.org/D89239



More information about the llvm-commits mailing list