[PATCH] D17294: Fix for PR 26500

Nemanja Ivanovic via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 16 08:27:04 PST 2016


nemanjai created this revision.
nemanjai added reviewers: hfinkel, kbarton, wschmidt, seurer.
nemanjai added a subscriber: llvm-commits.
nemanjai set the repository for this revision to rL LLVM.

The register used in emitPrologue/emitEpilogue to spill and reload the condition register is hard coded as R12. This isn't a problem in general, however when we shrink-wrap the function, the prologue/epilogue will end up in a block that may be using R12. In a case like that, we will clobber a value that is potentially needed.

This patch provides the support for acquiring an unused register for spilling the CR. In cases where there isn't an extra available register, the LR and CR will be spilled/reloaded using the same temporary register.

In the cases where we are not shrinkwrapping (i.e. the prologue/epilogue are staying put), we will not look for an available register since R12 is available.

Repository:
  rL LLVM

http://reviews.llvm.org/D17294

Files:
  lib/Target/PowerPC/PPCFrameLowering.cpp
  lib/Target/PowerPC/PPCFrameLowering.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17294.48073.patch
Type: text/x-patch
Size: 10792 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160216/b8ff1e0a/attachment.bin>


More information about the llvm-commits mailing list