[PATCH] D114457: [z/OS] Implement prologue and epilogue generation for z/OS target.

Neumann Hon via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 14 13:12:36 PST 2021


Everybody0523 updated this revision to Diff 394366.
Everybody0523 added a comment.

This generates STG instruction used to save the frame pointer correctly. It was previously generated as follows:

  BuildMI(MBB, MBBI, DL, ZII->get(SystemZ::STG), SystemZ::R0D)
      .addReg(SystemZ::R4D)
      .addImm(Offset)
      .addReg(0);

This was incorrect as the above invocation of BuildMI would cause the above instruction to define R0D (see here <https://llvm.org/doxygen/MachineInstrBuilder_8h_source.html#l00328>), which does not make sense for a store instruction. The correct way is to generate the instruction as follows:

  

  BuildMI(MBB, MBBI, DL, ZII->get(SystemZ::STG))
      .addReg(SystemZ::R0D)
      .addReg(SystemZ::R4D)
      .addImm(Offset)
      .addReg(0);

  


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

https://reviews.llvm.org/D114457

Files:
  llvm/lib/Target/SystemZ/SystemZCallingConv.td
  llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp
  llvm/lib/Target/SystemZ/SystemZFrameLowering.h
  llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
  llvm/test/CodeGen/SystemZ/call-zos-01.ll
  llvm/test/CodeGen/SystemZ/call-zos-vec.ll
  llvm/test/CodeGen/SystemZ/zos-prologue-epilog.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114457.394366.patch
Type: text/x-patch
Size: 16559 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211214/fdb63f1e/attachment.bin>


More information about the llvm-commits mailing list