[PowerPC] ELFv2 explicit CFI for CR fields
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Mon, 21 Jul 2014 00:03:18 +0000 (00:03 +0000)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Mon, 21 Jul 2014 00:03:18 +0000 (00:03 +0000)
commit970c019d02df4241b8fb52ad0d4817f0a78c668c
tree4a952d873269178d0073edab310d866bd8648f0e
parent68b292b026dbf397e869eb7c430a9e36ba4c7bc5
[PowerPC] ELFv2 explicit CFI for CR fields

This is a minor improvement in the ELFv2 ABI.   In ELFv1, DWARF CFI
would represent a saved CR word (holding CR fields CR2, CR3, and CR4)
using just a single CFI record refering to CR2.   In ELFv2 instead,
each of the CR fields is represented by its own CFI record.  The
advantage is that the compiler can now chose to save just a single
(or two) CR fields instead of all of them, if those are the only ones
that actually need saving.  That can lead to more efficient code using
mf(o)crf instead of the (slow) mfcr instruction.

Note that this patch does not (yet) implement this more efficient
code generation, but it does implement the part that is required to
be ABI compliant: creating multiple CFI records if multiple CR fields
are saved.

Reviewed by Hal Finkel.

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