[PATCH] D70821: [SystemZ] Implement the packed stack layout

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 7 10:37:40 PST 2019


jonpa updated this revision to Diff 232712.
jonpa marked 9 inline comments as done.
jonpa added a comment.

Patch updated per review.

Instead of caring religiously about which saved CSRs actually belonged in the reg save area and based on that deciding if the outgoing reg save are should be allocated, pach has been simplified per review comments:

- Save all the CSRs in fixed stack slots
  - packed stack: GPRs on top, then the rest in any order.
  - default: Per the offsets in table, and the rest below the incoming reg save area.
- Allocate the outgoing reg save area in the precence of any non-dead, non-fixed stack object per your suggestion ("HasStackObject"). This changes a few test cases, since e.g. F8 <https://reviews.llvm.org/F8> is now saved on a fixed stack slot instead of a non-fixed one as was done previously. The reason all CSRs now have fixed stack objects relates to MinCSFrameIndex / MaxCSFrameIndex as explained previously. This also makes a dozen or so files on SPEC not get the outgoing reg save area allocated anymore.
- Don't use the offset table with packed stack, instead rely on register numbers. Assert added to check that this is really ok.

- A new getOrCreateFramePointerSaveIndex() was created to share with SystemZISelLowering.
- I am not sure usePackedStack() is complete/correct, but it's a good start...
- More tests are probably needed.
- Front End patch yet todo.


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

https://reviews.llvm.org/D70821

Files:
  llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp
  llvm/lib/Target/SystemZ/SystemZFrameLowering.h
  llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
  llvm/lib/Target/SystemZ/SystemZMachineFunctionInfo.h
  llvm/test/CodeGen/SystemZ/anyregcc-novec.ll
  llvm/test/CodeGen/SystemZ/frame-02.ll
  llvm/test/CodeGen/SystemZ/frame-03.ll
  llvm/test/CodeGen/SystemZ/frame-04.ll
  llvm/test/CodeGen/SystemZ/frame-19.ll
  llvm/test/CodeGen/SystemZ/frame-20.ll
  llvm/test/CodeGen/SystemZ/frame-22.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70821.232712.patch
Type: text/x-patch
Size: 40376 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191207/a658552b/attachment.bin>


More information about the llvm-commits mailing list