[PowerPC] Disable shrink-wrapping when getting PC address through the LR
commitf41b0c1dff55d2d8c30f95dada248bb3e2e8c5cf
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Fri, 23 Feb 2018 23:08:34 +0000 (23 23:08 +0000)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Fri, 23 Feb 2018 23:08:34 +0000 (23 23:08 +0000)
tree208e2836965a64192da0ba1c4abbe622de5de815
parent3d238821f125366a4142f79f441db29b800a6b93
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325972 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCFrameLowering.cpp
lib/Target/PowerPC/PPCISelDAGToDAG.cpp
lib/Target/PowerPC/PPCMachineFunctionInfo.h
test/CodeGen/PowerPC/pr33547.ll [new file with mode: 0644]