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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122635 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Cameron Zwarich 2010-12-30 00:42:23 +00:00
parent e0f6db369d
commit d16ad3e43c

View File

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