Use getVRegDef() instead of def_iterator. This leads to fewer defs being added

with 2-address instructions, for about a 3.5% speedup of StrongPHIElimination on
403.gcc.

llvm-svn: 122635
This commit is contained in:
Cameron Zwarich 2010-12-30 00:42:23 +00:00
parent acc6b4e2fd
commit 2f6dc10ccc
1 changed files with 3 additions and 4 deletions

View File

@ -233,10 +233,9 @@ bool StrongPHIElimination::runOnMachineFunction(MachineFunction& MF) {
addReg(SrcReg); addReg(SrcReg);
unionRegs(DestReg, SrcReg); unionRegs(DestReg, SrcReg);
for (MachineRegisterInfo::def_iterator DI = MRI->def_begin(SrcReg), MachineInstr* DefMI = MRI->getVRegDef(SrcReg);
DE = MRI->def_end(); DI != DE; ++DI) { if (DefMI)
PHISrcDefs[DI->getParent()].push_back(&*DI); PHISrcDefs[DefMI->getParent()].push_back(DefMI);
}
} }
} }
} }