[PowerPC] Disable shrink-wrapping when getting PC address through the LR
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Fri, 23 Feb 2018 23:08:34 +0000 (23:08 +0000)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Fri, 23 Feb 2018 23:08:34 +0000 (23:08 +0000)
commitbcc82c9a78b1690af80836093aa32ab8470cc8f4
tree03f008a4d17d1cdd0d529637805bc26be2cac20b
parent68ac9417801da389cb1e72afa8677b8b99e33e63
[PowerPC] Disable shrink-wrapping when getting PC address through the LR

The instruction sequence used to get the address of the PC into a GPR requires
that we clobber the link register. Doing so without having first saved it in
the prologue leaves the function unable to return. Currently, this sequence is
emitted into the entry block. To ensure the prologue is inserted before this
sequence, disable shrink-wrapping.

This fixes PR33547.

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

llvm-svn: 325972
llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.h
llvm/test/CodeGen/PowerPC/pr33547.ll [new file with mode: 0644]