[SystemZ] Support builtin_{frame,return}_address() with non-zero argument (#69405)
commit8e810dc7d93bebe5e2d3980d4db084f58248b37f
authorIlya Leoshkevich <iii@linux.ibm.com>
Wed, 18 Oct 2023 17:05:31 +0000 (18 19:05 +0200)
committerGitHub <noreply@github.com>
Wed, 18 Oct 2023 17:05:31 +0000 (18 19:05 +0200)
tree0a70da1066345baf6d258142a3880572ac283a71
parentb69081e3241be6c310ca98ecdad53643dd804e25
[SystemZ] Support builtin_{frame,return}_address() with non-zero argument (#69405)

When the code is built with -mbackchain, it is possible to retrieve the
caller's frame and return addresses. GCC already can do this, add this
support to Clang as well. Use RISCVTargetLowering and GCC's
s390_return_addr_rtx() as inspiration. Add tests based on what GCC is
emitting.
llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
llvm/test/CodeGen/SystemZ/frameaddr-01.ll
llvm/test/CodeGen/SystemZ/frameaddr-02.ll
llvm/test/CodeGen/SystemZ/ret-addr-01.ll
llvm/test/CodeGen/SystemZ/ret-addr-02.ll [new file with mode: 0644]