[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)
commitbe928cc276b9709ec6fbfac65fa814bfd1dddaa2
tree7542157374a276f31bfa6703fe509a07d775a0df
parent752b5c9e6efe3d081862e531290f0552447dc0c0
[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.

llvm-svn: 213492
llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
llvm/test/CodeGen/PowerPC/ppc64le-crsave.ll [new file with mode: 0644]