mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +01:00
Vectors that are known live-in and live-out are clearly already marked in
the vrsave register for the caller. This allows us to codegen a function as: _test_rol: mfspr r2, 256 mr r3, r2 mtspr 256, r3 vspltisw v2, -12 vrlw v2, v2, v2 mtspr 256, r2 blr instead of: _test_rol: mfspr r2, 256 oris r3, r2, 40960 mtspr 256, r3 vspltisw v0, -12 vrlw v2, v0, v0 mtspr 256, r2 blr llvm-svn: 27772
This commit is contained in:
parent
a717d4f53b
commit
021f521a41
@ -355,6 +355,22 @@ static void HandleVRSaveUpdate(MachineInstr *MI, const bool *UsedRegs) {
|
||||
if (UsedRegs[VRRegNo[i]])
|
||||
UsedRegMask |= 1 << (31-i);
|
||||
|
||||
// Live in and live out values already must be in the mask, so don't bother
|
||||
// marking them.
|
||||
MachineFunction *MF = MI->getParent()->getParent();
|
||||
for (MachineFunction::livein_iterator I =
|
||||
MF->livein_begin(), E = MF->livein_end(); I != E; ++I) {
|
||||
unsigned RegNo = PPCRegisterInfo::getRegisterNumbering(I->first);
|
||||
if (VRRegNo[RegNo] == I->first) // If this really is a vector reg.
|
||||
UsedRegMask &= ~(1 << (31-RegNo)); // Doesn't need to be marked.
|
||||
}
|
||||
for (MachineFunction::liveout_iterator I =
|
||||
MF->liveout_begin(), E = MF->liveout_end(); I != E; ++I) {
|
||||
unsigned RegNo = PPCRegisterInfo::getRegisterNumbering(*I);
|
||||
if (VRRegNo[RegNo] == *I) // If this really is a vector reg.
|
||||
UsedRegMask &= ~(1 << (31-RegNo)); // Doesn't need to be marked.
|
||||
}
|
||||
|
||||
unsigned SrcReg = MI->getOperand(1).getReg();
|
||||
unsigned DstReg = MI->getOperand(0).getReg();
|
||||
// If no registers are used, turn this into a copy.
|
||||
|
Loading…
Reference in New Issue
Block a user