Use existing function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140615 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen 2011-09-27 17:55:08 +00:00
parent 237e7a278a
commit 8e695eb5fa

View File

@ -40,8 +40,6 @@ namespace {
typedef DenseMap<unsigned, const MachineInstr*> RegMap;
bool InsertMoves(MachineBasicBlock &MBB);
void TransferImpOps(MachineInstr &Old, MachineInstr &New);
};
char NEONMoveFixPass::ID = 0;
}
@ -51,16 +49,6 @@ static bool inNEONDomain(unsigned Domain, bool isA8) {
(isA8 && (Domain & ARMII::DomainNEONA8));
}
/// Transfer implicit kill and def operands from Old to New.
void NEONMoveFixPass::TransferImpOps(MachineInstr &Old, MachineInstr &New) {
for (unsigned i = 0, e = Old.getNumOperands(); i != e; ++i) {
MachineOperand &MO = Old.getOperand(i);
if (!MO.isReg() || !MO.isImplicit())
continue;
New.addOperand(MO);
}
}
bool NEONMoveFixPass::InsertMoves(MachineBasicBlock &MBB) {
RegMap Defs;
bool Modified = false;
@ -100,7 +88,7 @@ bool NEONMoveFixPass::InsertMoves(MachineBasicBlock &MBB) {
AddDefaultPred(BuildMI(MBB, *MI, MI->getDebugLoc(),
TII->get(ARM::VORRd), DestReg)
.addReg(SrcReg).addReg(SrcReg));
TransferImpOps(*MI, *NewMI);
NewMI->copyImplicitOps(MI);
MBB.erase(MI);
MI = NewMI;