[PowerPC] Utilize DQ-Form instructions for spill/restore and fix FrameIndex elimination to only use lis/addi if necessary.
Currently we produce a bunch of unnecessary code when emitting the
prologue/epilogue for spills/restores. Namely, if the load from stack
slot/store to stack slot instruction is an X-Form instruction, we will
always produce an LIS/ORI sequence for the stack offset.
Furthermore, we have not exploited the P9 vector D-Form loads/stores for this
This patch address both issues.
Specifying the D-Form load as the instruction to use for stack spills/reloads
should be safe because:
- The stack should be aligned according to the ABI
- If the stack isn't aligned, PPCRegisterInfo::eliminateFrameIndex() will check for the offset being a multiple of 16 and will convert it to an X-Form instruction if it isn't.
Differential Revision : https://reviews.llvm.org/D38758