[Sparc] Flush register windows for @llvm.returnaddress(1)
authorDaniel Cederman <cederman@gaisler.com>
Fri, 17 Aug 2018 09:18:31 +0000 (09:18 +0000)
committerDaniel Cederman <cederman@gaisler.com>
Fri, 17 Aug 2018 09:18:31 +0000 (09:18 +0000)
commit7d3e08ff8d017018e6ab408f571c7e9781e7e54d
tree00c2103638a617155bb85803d81b5f1f33480faa
parent4c0c37df4cccbee18f2a886d0ccb3bc8cc59be6b
[Sparc] Flush register windows for @llvm.returnaddress(1)

Summary: When @llvm.returnaddress is called with a value higher than 0
it needs to read from the call stack to get the return address. This
means that the register windows needs to be flushed to the stack to
guarantee that the data read is valid. For values higher than 1 this
is done indirectly by the call to getFRAMEADDR(), but not for the value 1.

Reviewers: jyknight, venkatra

Reviewed By: jyknight

Subscribers: fedor.sergeev, jrtc27, llvm-commits

Differential Revision: https://reviews.llvm.org/D48636

llvm-svn: 340003
llvm/lib/Target/Sparc/SparcISelLowering.cpp
llvm/test/CodeGen/SPARC/2011-01-11-FrameAddr.ll